@Test public void testCompareToTransitive() throws Exception { final int sign = Integer.signum(a.compareTo(b)); Assert.assertEquals("compareTo(a,b) and compareTo(b,c) should have the same sign.", sign, Integer.signum(b.compareTo(c))); Assert.assertEquals("if a > b > c, compareTo(a,c) should be consistent.", sign, Integer.signum(a.compareTo(c))); }
@Override public int compareTo(final RyaType o) { if (o == null) { return 1; } final String dataTypeStr = getDataType() != null ? getDataType().stringValue() : null; final String otherDataTypeStr = o.getDataType() != null ? o.getDataType().stringValue() : null; final CompareToBuilder builder = new CompareToBuilder() .append(getData(), o.getData()) .append(dataTypeStr, otherDataTypeStr) .append(getLanguage(), o.getLanguage()); return builder.toComparison(); }
RyaType implements Comparable<RyaType> { @Override public int compareTo(final RyaType o) { if (o == null) { return 1; } final String dataTypeStr = getDataType() != null ? getDataType().stringValue() : null; final String otherDataTypeStr = o.getDataType() != null ? o.getDataType().stringValue() : null; final CompareToBuilder builder = new CompareToBuilder() .append(getData(), o.getData()) .append(dataTypeStr, otherDataTypeStr) .append(getLanguage(), o.getLanguage()); return builder.toComparison(); } }
RyaType implements Comparable<RyaType> { @Override public int compareTo(final RyaType o) { if (o == null) { return 1; } final String dataTypeStr = getDataType() != null ? getDataType().stringValue() : null; final String otherDataTypeStr = o.getDataType() != null ? o.getDataType().stringValue() : null; final CompareToBuilder builder = new CompareToBuilder() .append(getData(), o.getData()) .append(dataTypeStr, otherDataTypeStr) .append(getLanguage(), o.getLanguage()); return builder.toComparison(); } RyaType();  RyaType(final String data);  RyaType(final IRI dataType, final String data);  RyaType(final IRI dataType, final String data, final String language); }
RyaType implements Comparable<RyaType> { @Override public int compareTo(final RyaType o) { if (o == null) { return 1; } final String dataTypeStr = getDataType() != null ? getDataType().stringValue() : null; final String otherDataTypeStr = o.getDataType() != null ? o.getDataType().stringValue() : null; final CompareToBuilder builder = new CompareToBuilder() .append(getData(), o.getData()) .append(dataTypeStr, otherDataTypeStr) .append(getLanguage(), o.getLanguage()); return builder.toComparison(); } RyaType();  RyaType(final String data);  RyaType(final IRI dataType, final String data);  RyaType(final IRI dataType, final String data, final String language); IRI getDataType(); String getData(); void setDataType(final IRI dataType); void setData(final String data); String getLanguage(); void setLanguage(final String language); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); @Override int compareTo(final RyaType o); }
RyaType implements Comparable<RyaType> { @Override public int compareTo(final RyaType o) { if (o == null) { return 1; } final String dataTypeStr = getDataType() != null ? getDataType().stringValue() : null; final String otherDataTypeStr = o.getDataType() != null ? o.getDataType().stringValue() : null; final CompareToBuilder builder = new CompareToBuilder() .append(getData(), o.getData()) .append(dataTypeStr, otherDataTypeStr) .append(getLanguage(), o.getLanguage()); return builder.toComparison(); } RyaType();  RyaType(final String data);  RyaType(final IRI dataType, final String data);  RyaType(final IRI dataType, final String data, final String language); IRI getDataType(); String getData(); void setDataType(final IRI dataType); void setData(final String data); String getLanguage(); void setLanguage(final String language); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); @Override int compareTo(final RyaType o);  }