@Test public void testCompareTo() throws Exception { Assert.assertEquals("compareTo(self) should return zero.", 0, aIri.compareTo(aIri)); Assert.assertFalse("compareTo should return nonzero for different data and type.", aIri.compareTo(b) == 0); Assert.assertFalse("compareTo should return nonzero for same data and different datatypes.", a.compareTo(aIri) == 0); Assert.assertFalse("compareTo should return nonzero for same datatype and different data.", bIri.compareTo(aIri) == 0); Assert.assertEquals("compareTo should return zero for different objects with matching data and datatype.", 0, a.compareTo(same)); Assert.assertEquals("compareTo(self) return zero.", 0, aLang.compareTo(aLang)); Assert.assertFalse("compareTo should return nonzero for different languages.", aLang.compareTo(aDiffLang) == 0); Assert.assertFalse("compareTo should return nonzero for same datatype and language and different data.", aLang.compareTo(bLang) == 0); }
@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);  }