@Override public boolean isValue(Object obj) { if (obj == null || obj instanceof SimpleValue == false) return false; SimpleValue value = (SimpleValue) obj; return equals(value.getMetaType()); }
@Override public boolean isValue(Object obj) { if (obj == null || obj instanceof SimpleValue == false) return false; SimpleValue value = (SimpleValue) obj; if (SimpleMetaType.STRING == value.getMetaType() == false) return false; return validValues.contains(value.getValue()); }
@Override public boolean isValue(Object obj) { if (obj == null || obj instanceof SimpleValue == false) return false; SimpleValue value = (SimpleValue) obj; return equals(value.getMetaType()); }
public int compare(SimpleValue o1, SimpleValue o2) { SimpleMetaType smt1 = o1.getMetaType(); SimpleMetaType smt2 = o2.getMetaType(); return (smt1 == smt2) ? smt1.compare(o1.getValue(), o2.getValue()) : -1; } }
@Override public boolean equals(Object obj) { if (obj == this) return true; if (obj == null || obj instanceof SimpleValue == false) return false; SimpleValue other = (SimpleValue) obj; if (metaType.equals(other.getMetaType()) == false) { // Check equivalent types if (metaType.equalsIgnorePrimitive(other.getMetaType()) == false) return false; } Object otherValue = other.getValue(); if (value == null && otherValue == null) return true; if (value == null && otherValue != null) return false; return value.equals(otherValue); }
@Override public boolean equals(Object obj) { if (obj == this) return true; if (obj == null || obj instanceof SimpleValue == false) return false; SimpleValue other = (SimpleValue) obj; if (metaType.equals(other.getMetaType()) == false) return false; Object otherValue = other.getValue(); if (value == null && otherValue == null) return true; if (value == null && otherValue != null) return false; return value.equals(otherValue); }
/** * Validate that obj is a SimpleValue.STRING or EnumValue whose string * value is in the set of valid enum strings. * @return true if obj is a valid enum string for this type. */ @Override public boolean isValue(Object obj) { if (obj == null || (obj instanceof SimpleValue == false && obj instanceof EnumValue == false)) return false; String enumString = null; if(obj instanceof SimpleValue) { SimpleValue value = SimpleValue.class.cast(obj); if (SimpleMetaType.STRING == value.getMetaType() == false) return false; enumString = value.getValue().toString(); } else { EnumValue value = EnumValue.class.cast(obj); enumString = value.getValue(); } return validValues.contains(enumString); }
if(getMetaType() == SimpleMetaType.BIGINTEGER && sv.getMetaType() == SimpleMetaType.BIGINTEGER) else if(getMetaType() == SimpleMetaType.BIGDECIMAL && sv.getMetaType() == SimpleMetaType.BIGDECIMAL) else if(getMetaType() == SimpleMetaType.BOOLEAN && sv.getMetaType() == SimpleMetaType.BOOLEAN) else if(getMetaType() == SimpleMetaType.BOOLEAN_PRIMITIVE && sv.getMetaType() == SimpleMetaType.BOOLEAN_PRIMITIVE) else if(getMetaType() == SimpleMetaType.BYTE && sv.getMetaType() == SimpleMetaType.BYTE) else if(getMetaType() == SimpleMetaType.CHARACTER && sv.getMetaType() == SimpleMetaType.CHARACTER) else if(getMetaType() == SimpleMetaType.CHARACTER_PRIMITIVE && sv.getMetaType() == SimpleMetaType.CHARACTER_PRIMITIVE) else if(getMetaType() == SimpleMetaType.DATE && sv.getMetaType() == SimpleMetaType.DATE) else if(getMetaType() == SimpleMetaType.DOUBLE && sv.getMetaType() == SimpleMetaType.DOUBLE) else if(getMetaType() == SimpleMetaType.FLOAT && sv.getMetaType() == SimpleMetaType.FLOAT) else if(getMetaType() == SimpleMetaType.INTEGER && sv.getMetaType() == SimpleMetaType.INTEGER) else if(getMetaType() == SimpleMetaType.LONG && sv.getMetaType() == SimpleMetaType.LONG) else if(getMetaType() == SimpleMetaType.SHORT && sv.getMetaType() == SimpleMetaType.SHORT) else if(getMetaType() == SimpleMetaType.STRING && sv.getMetaType() == SimpleMetaType.STRING) else if(getMetaType() == SimpleMetaType.NAMEDOBJECT && sv.getMetaType() == SimpleMetaType.NAMEDOBJECT)