public String toString() { return Objects.toStringHelper(SchemaPropertyList.class) .add("type", getCollectionType()).add("collectionType", getCollectionType()) .add("defaultValue", getDefaultValues()).toString(); }
@Override public boolean equals(Object obj) { if (!(obj instanceof SchemaPropertyList)) { return false; } SchemaPropertyList o = (SchemaPropertyList) obj; return equals(o) && equal(getCollectionType(), o.getCollectionType()) && equal(getType(), o.getType()); } }
@Override public int hashCode() { return Objects.hashCode(super.getHashCode(), getType(), getCollectionType()); }
private void convertPropertyList(Bean source, Map<String, Object> values) { for (SchemaPropertyList prop : source.getSchema().get(SchemaPropertyList.class)) { List<String> vals = source.getValues(prop.getName()); String field = prop.getFieldName(); if (vals == null) { continue; } Collection<Object> c = newCollection(forName(prop.getCollectionType())); for (String val : vals) { Object converted = conversion.convert(val, forName(prop.getType())); c.add(converted); } values.put(field, c); } }
private void convertPropertyList(Bean source, Map<String, Object> values) { for (SchemaPropertyList prop : source.getSchema().get(SchemaPropertyList.class)) { List<String> vals = source.getValues(prop.getName()); String field = prop.getFieldName(); if (vals == null) { continue; } Collection<Object> c = newCollection(loadClass(prop.getCollectionType())); for (String val : vals) { Object converted = conversion.convert(val, loadClass(prop.getType())); c.add(converted); } values.put(field, c); } }
public XmlSchemaCollection(SchemaPropertyList p) { this.name = p.getName(); this.fieldName = p.getFieldName(); this.parameterizedType = p.getType(); this.collectionType = p.getCollectionType(); this.desc = p.getDesc(); this.isImmutable = p.isImmutable(); this.isImmutable = p.isEnum(); this.defaultValues = p.getDefaultValues(); } }