/** * Returns a hashcode compatible with the equals method. * * @return the hashcode */ public int hashCode() { return get() * 17 + getFieldType().hashCode() + getChronology().hashCode(); }
/** * Returns a hashcode compatible with the equals method. * * @return the hashcode */ public int hashCode() { return get() * 17 + getFieldType().hashCode() + getChronology().hashCode(); }
/** * Compare this field to the same field on another instant. * <p> * The comparison is based on the value of the same field type, irrespective * of any difference in chronology. Thus, if this property represents the * hourOfDay field, then the hourOfDay field of the other instant will be queried * whether in the same chronology or not. * * @param instant the instant to compare to * @return negative value if this is less, 0 if equal, or positive value if greater * @throws IllegalArgumentException if the instant is null */ public int compareTo(ReadableInstant instant) { if (instant == null) { throw new IllegalArgumentException("The instant must not be null"); } int thisValue = get(); int otherValue = instant.get(getFieldType()); if (thisValue < otherValue) { return -1; } else if (thisValue > otherValue) { return 1; } else { return 0; } }
/** * Compare this field to the same field on another partial instant. * <p> * The comparison is based on the value of the same field type, irrespective * of any difference in chronology. Thus, if this property represents the * hourOfDay field, then the hourOfDay field of the other partial will be queried * whether in the same chronology or not. * * @param partial the partial to compare to * @return negative value if this is less, 0 if equal, or positive value if greater * @throws IllegalArgumentException if the partial is null * @throws IllegalArgumentException if the partial doesn't support this field */ public int compareTo(ReadablePartial partial) { if (partial == null) { throw new IllegalArgumentException("The partial must not be null"); } int thisValue = get(); int otherValue = partial.get(getFieldType()); if (thisValue < otherValue) { return -1; } else if (thisValue > otherValue) { return 1; } else { return 0; } }
/** * Compare this field to the same field on another partial instant. * <p> * The comparison is based on the value of the same field type, irrespective * of any difference in chronology. Thus, if this property represents the * hourOfDay field, then the hourOfDay field of the other partial will be queried * whether in the same chronology or not. * * @param partial the partial to compare to * @return negative value if this is less, 0 if equal, or positive value if greater * @throws IllegalArgumentException if the partial is null * @throws IllegalArgumentException if the partial doesn't support this field */ public int compareTo(ReadablePartial partial) { if (partial == null) { throw new IllegalArgumentException("The partial must not be null"); } int thisValue = get(); int otherValue = partial.get(getFieldType()); if (thisValue < otherValue) { return -1; } else if (thisValue > otherValue) { return 1; } else { return 0; } }
/** * Compare this field to the same field on another instant. * <p> * The comparison is based on the value of the same field type, irrespective * of any difference in chronology. Thus, if this property represents the * hourOfDay field, then the hourOfDay field of the other instant will be queried * whether in the same chronology or not. * * @param instant the instant to compare to * @return negative value if this is less, 0 if equal, or positive value if greater * @throws IllegalArgumentException if the instant is null */ public int compareTo(ReadableInstant instant) { if (instant == null) { throw new IllegalArgumentException("The instant must not be null"); } int thisValue = get(); int otherValue = instant.get(getFieldType()); if (thisValue < otherValue) { return -1; } else if (thisValue > otherValue) { return 1; } else { return 0; } }
/** * Compares this property to another. * * @param object the object to compare to * @return true if equal */ public boolean equals(Object object) { if (this == object) { return true; } if (object instanceof AbstractReadableInstantFieldProperty == false) { return false; } AbstractReadableInstantFieldProperty other = (AbstractReadableInstantFieldProperty) object; return get() == other.get() && getFieldType().equals(other.getFieldType()) && FieldUtils.equals(getChronology(), other.getChronology()); }
/** * Compares this property to another. * * @param object the object to compare to * @return true if equal */ public boolean equals(Object object) { if (this == object) { return true; } if (object instanceof AbstractReadableInstantFieldProperty == false) { return false; } AbstractReadableInstantFieldProperty other = (AbstractReadableInstantFieldProperty) object; return get() == other.get() && getFieldType().equals(other.getFieldType()) && FieldUtils.equals(getChronology(), other.getChronology()); }
/** * Returns a hashcode compatible with the equals method. * * @return the hashcode */ public int hashCode() { return get() * 17 + getFieldType().hashCode() + getChronology().hashCode(); }
/** * Compare this field to the same field on another instant. * <p> * The comparison is based on the value of the same field type, irrespective * of any difference in chronology. Thus, if this property represents the * hourOfDay field, then the hourOfDay field of the other instant will be queried * whether in the same chronology or not. * * @param instant the instant to compare to * @return negative value if this is less, 0 if equal, or positive value if greater * @throws IllegalArgumentException if the instant is null */ public int compareTo(ReadableInstant instant) { if (instant == null) { throw new IllegalArgumentException("The instant must not be null"); } int thisValue = get(); int otherValue = instant.get(getFieldType()); if (thisValue < otherValue) { return -1; } else if (thisValue > otherValue) { return 1; } else { return 0; } }
/** * Compare this field to the same field on another partial instant. * <p> * The comparison is based on the value of the same field type, irrespective * of any difference in chronology. Thus, if this property represents the * hourOfDay field, then the hourOfDay field of the other partial will be queried * whether in the same chronology or not. * * @param partial the partial to compare to * @return negative value if this is less, 0 if equal, or positive value if greater * @throws IllegalArgumentException if the partial is null * @throws IllegalArgumentException if the partial doesn't support this field */ public int compareTo(ReadablePartial partial) { if (partial == null) { throw new IllegalArgumentException("The partial must not be null"); } int thisValue = get(); int otherValue = partial.get(getFieldType()); if (thisValue < otherValue) { return -1; } else if (thisValue > otherValue) { return 1; } else { return 0; } }
/** * Compares this property to another. * * @param object the object to compare to * @return true if equal */ public boolean equals(Object object) { if (this == object) { return true; } if (object instanceof AbstractReadableInstantFieldProperty == false) { return false; } AbstractReadableInstantFieldProperty other = (AbstractReadableInstantFieldProperty) object; return get() == other.get() && getFieldType().equals(other.getFieldType()) && FieldUtils.equals(getChronology(), other.getChronology()); }
/** * Returns a hashcode compatible with the equals method. * * @return the hashcode */ public int hashCode() { return get() * 17 + getFieldType().hashCode() + getChronology().hashCode(); }
/** * Returns a hashcode compatible with the equals method. * * @return the hashcode */ public int hashCode() { return get() * 17 + getFieldType().hashCode() + getChronology().hashCode(); }
/** * Returns a hashcode compatible with the equals method. * * @return the hashcode */ public int hashCode() { return get() * 17 + getFieldType().hashCode() + getChronology().hashCode(); }
/** * Returns a hashcode compatible with the equals method. * * @return the hashcode */ public int hashCode() { return get() * 17 + getFieldType().hashCode() + getChronology().hashCode(); }
/** * Returns a hashcode compatible with the equals method. * * @return the hashcode */ public int hashCode() { return get() * 17 + getFieldType().hashCode() + getChronology().hashCode(); }
/** * Returns a hashcode compatible with the equals method. * * @return the hashcode */ public int hashCode() { return get() * 17 + getFieldType().hashCode() + getChronology().hashCode(); }
/** * Returns a hashcode compatible with the equals method. * * @return the hashcode */ public int hashCode() { return get() * 17 + getFieldType().hashCode() + getChronology().hashCode(); }
/** * Returns a hashcode compatible with the equals method. * * @return the hashcode */ public int hashCode() { return get() * 17 + getFieldType().hashCode() + getChronology().hashCode(); }