public PrincessPropertyArrayItem addData(int propertyKey, int level, int experience) {
   PrincessPropertyArrayItem item = new PrincessPropertyArrayItem();
   item.setPropertyKey(propertyKey);
   item.setLevel(level);
   item.setExperience(experience);
   list.add(item);
   return item;
 }
 @Override
 public boolean validate() {
   for (PrincessPropertyArrayItem item : list) {
     if (!item.validate()) {
       return false;
     }
   }
   return true;
 }
 /** 编码 */
 @Override
 public void encode(Data data) {
   data.writeInt(list.size());
   for (PrincessPropertyArrayItem item : list) {
     data.writeInt(item.getPropertyKey());
     data.writeInt(item.getLevel());
     data.writeInt(item.getExperience());
   }
 }
 /** 解码 */
 @Override
 public void decode(Data data) {
   int size = data.getInt();
   for (int i = 0; i < size; i++) {
     PrincessPropertyArrayItem item = PrincessPropertyArrayItem.create();
     item.setPropertyKey(data.getInt());
     item.setLevel(data.getInt());
     item.setExperience(data.getInt());
     list.add(item);
   }
 }
 public String toString() {
   StringBuilder bb = new StringBuilder();
   bb.append("[");
   int i = 0;
   for (PrincessPropertyArrayItem item : list) {
     bb.append("{").append(item.toString()).append("}");
     i++;
     if (i != list.size()) {
       bb.append(", ");
     }
   }
   bb.append("]");
   return bb.toString();
 }