public boolean isEmpty() { return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) && (created == null || created.isEmpty()); }
private static ValueType newValueType( Map<Type, ValueType> typeMap, Type type, Class declaringClass, Class compositeType) { ValueType valueType = null; if (CollectionType.isCollection(type)) { if (type instanceof ParameterizedType) { ParameterizedType pt = (ParameterizedType) type; Type collectionType = pt.getActualTypeArguments()[0]; if (collectionType instanceof TypeVariable) { TypeVariable collectionTypeVariable = (TypeVariable) collectionType; collectionType = Classes.resolveTypeVariable(collectionTypeVariable, declaringClass, compositeType); } ValueType collectedType = newValueType(typeMap, collectionType, declaringClass, compositeType); valueType = new CollectionType(nameOf(type), collectedType); } else { valueType = new CollectionType( nameOf(type), newValueType(typeMap, Object.class, declaringClass, compositeType)); } } else if (ValueCompositeType.isValueComposite(type)) { if (typeMap != null) { valueType = typeMap.get(type); } if (valueType == null) { Class valueTypeClass = Classes.getRawClass(type); List<PropertyType> types = new ArrayList<PropertyType>(); valueType = new ValueCompositeType(nameOf(valueTypeClass), types); if (typeMap == null) { typeMap = new HashMap<Type, ValueType>(); } typeMap.put(type, valueType); addProperties(typeMap, valueTypeClass, compositeType, types); Collections.sort(types); // Sort by property name } } else if (EnumType.isEnum(type)) { valueType = new EnumType(nameOf(type)); } else if (StringType.isString(type)) { valueType = new StringType(); } else if (NumberType.isNumber(type)) { valueType = new NumberType(nameOf(type)); } else if (BooleanType.isBoolean(type)) { valueType = new BooleanType(); } else if (DateType.isDate(type)) { valueType = new DateType(); } else if (EntityReferenceType.isEntityReference(type)) { valueType = new EntityReferenceType(nameOf(type)); } else { // TODO: shouldn't we check that the type is a Serializable? valueType = new SerializableType(nameOf(type)); } return valueType; }
public Basic copy() { Basic dst = new Basic(); copyValues(dst); if (identifier != null) { dst.identifier = new ArrayList<Identifier>(); for (Identifier i : identifier) dst.identifier.add(i.copy()); } ; dst.code = code == null ? null : code.copy(); dst.subject = subject == null ? null : subject.copy(); dst.author = author == null ? null : author.copy(); dst.created = created == null ? null : created.copy(); return dst; }
public PaymentNotice copy() { PaymentNotice dst = new PaymentNotice(); copyValues(dst); if (identifier != null) { dst.identifier = new ArrayList<Identifier>(); for (Identifier i : identifier) dst.identifier.add(i.copy()); } ; dst.ruleset = ruleset == null ? null : ruleset.copy(); dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); dst.created = created == null ? null : created.copy(); dst.target = target == null ? null : target.copy(); dst.provider = provider == null ? null : provider.copy(); dst.organization = organization == null ? null : organization.copy(); dst.request = request == null ? null : request.copy(); dst.response = response == null ? null : response.copy(); dst.paymentStatus = paymentStatus == null ? null : paymentStatus.copy(); dst.statusDate = statusDate == null ? null : statusDate.copy(); return dst; }