@Override public int compareTo(PropertyValue o) { int result; if (this.isNull() && o.isNull()) { result = 0; } else if (this.isNumber() && o.isNumber()) { result = PropertyValueUtils.Numeric.compare(this, o); } else if (this.isBoolean() && o.isBoolean()) { result = Boolean.compare(this.getBoolean(), o.getBoolean()); } else if (this.isString() && o.isString()) { result = this.getString().compareTo(o.getString()); } else if (this.isGradoopId() && o.isGradoopId()) { result = this.getGradoopId().compareTo(o.getGradoopId()); } else if (this.isDate() && o.isDate()) { result = this.getDate().compareTo(o.getDate()); } else if (this.isTime() && o.isTime()) { result = this.getTime().compareTo(o.getTime()); } else if (this.isDateTime() && o.isDateTime()) { result = this.getDateTime().compareTo(o.getDateTime()); } else if (this.isMap() || o.isMap() || this.isList() || o.isList() || this.isSet() || o.isSet()) { throw new UnsupportedOperationException(String.format( "Method compareTo() is not supported for %s, %s", this.getClass(), o.getClass())); } else { throw new IllegalArgumentException(String.format( "Incompatible types: %s, %s", this.getClass(), o.getClass())); } return result; }