@Override
 public void write(TPDataOutput out, Connection<?> conn) throws IOException {
   super.write(out, conn);
   out.writeInteger(this.id);
   out.writeInteger(this.modtime);
   out.writeInteger(this.categories.size());
   for (CategoriesType object : this.categories) object.write(out, conn);
   out.writeString(this.name);
   out.writeString(this.description);
   out.writeString(this.requirements);
   out.writeInteger(this.properties.size());
   for (PropertiesType object : this.properties) object.write(out, conn);
 }
 @Override
 public PropertiesType marshal(TypedProperties tp) throws Exception {
   PropertiesType pxml = new PropertiesType();
   Property[] pa = new Property[tp.size()];
   Set<Entry<Object, Object>> set = tp.entrySet();
   int index = 0;
   for (Entry<Object, Object> entry : set) {
     pa[index] = new Property();
     pa[index].name = (String) entry.getKey();
     pa[index].value = (String) entry.getValue();
     index++;
   }
   pxml.properties = pa;
   return pxml;
 }
 /** A copy constructor for (among others) deep-copying groups and lists. */
 public PropertiesType(PropertiesType copy) {
   setId(copy.getId());
   setValuefunc(copy.getValuefunc());
 }
示例#4
0
 public synchronized boolean equals(java.lang.Object obj) {
   if (!(obj instanceof PropertiesType)) return false;
   PropertiesType other = (PropertiesType) obj;
   if (obj == null) return false;
   if (this == obj) return true;
   if (__equalsCalc != null) {
     return (__equalsCalc == obj);
   }
   __equalsCalc = obj;
   boolean _equals;
   _equals =
       true
           && ((this.created == null && other.getCreated() == null)
               || (this.created != null && this.created.equals(other.getCreated())))
           && ((this.createdBy == null && other.getCreatedBy() == null)
               || (this.createdBy != null && this.createdBy.equals(other.getCreatedBy())))
           && ((this.lastUpdated == null && other.getLastUpdated() == null)
               || (this.lastUpdated != null && this.lastUpdated.equals(other.getLastUpdated())))
           && ((this.lastUpdatedBy == null && other.getLastUpdatedBy() == null)
               || (this.lastUpdatedBy != null
                   && this.lastUpdatedBy.equals(other.getLastUpdatedBy())))
           && ((this.kilobytes == null && other.getKilobytes() == null)
               || (this.kilobytes != null && this.kilobytes.equals(other.getKilobytes())))
           && ((this.mimeType == null && other.getMimeType() == null)
               || (this.mimeType != null && this.mimeType.equals(other.getMimeType())))
           && ((this.associatedGroups == null && other.getAssociatedGroups() == null)
               || (this.associatedGroups != null
                   && java.util.Arrays.equals(
                       this.associatedGroups, other.getAssociatedGroups())));
   __equalsCalc = null;
   return _equals;
 }