@Test public void testCompareToNullFields() throws Exception { Assert.assertEquals("[has no nulls].compareTo([has null data]) should return 1", 1, a.compareTo(nullData)); Assert.assertEquals("[has no nulls].compareTo([has null type]) should return 1 if data is equal", 1, a.compareTo(nullType)); Assert.assertEquals("[has null data].compareTo([has no nulls]) should return -1", -1, nullData.compareTo(a)); Assert.assertEquals("[has null type].compareTo([has no nulls]) should return -1 if data is equal", -1, nullType.compareTo(a)); Assert.assertEquals("[has null type].compareTo([has null data]) should return 1", 1, nullType.compareTo(nullData)); Assert.assertEquals("[has no nulls].compareTo([has null lang]) should return 1", 1, aLang.compareTo(nullLang)); }
@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);  }