/** * A separate equalsContent method for checking whether literals are equal in their content; we cannot override * the .equals function with this because it would break the system in cases where the same content is used in * different literals. * * @param o * @return */ @Override public boolean equals(Object o) { if (this == o) return true; if(o instanceof Literal) { Literal that = (Literal)o; if(!this.getLabel().equals(that.getLabel())) return false; if(this.getLanguage() != null && !(this.getLanguage().equals(that.getLanguage()))) return false; // getDatatype should never be null, this is only for legacy support if(this.getDatatype()==null && that.getDatatype()!=null) return false; return !(this.getDatatype() != null && !this.getDatatype().equals(that.getDatatype())); } return false; }
/** * A separate equalsContent method for checking whether literals are equal in their content; we cannot override * the .equals function with this because it would break the system in cases where the same content is used in * different literals. * * @param o * @return */ @Override public boolean equals(Object o) { if (this == o) return true; if(o instanceof Literal) { Literal that = (Literal)o; if(!this.getLabel().equals(that.getLabel())) return false; if(this.getLanguage() != null && !(this.getLanguage().equals(that.getLanguage()))) return false; // getDatatype should never be null, this is only for legacy support if(this.getDatatype()==null && that.getDatatype()!=null) return false; return !(this.getDatatype() != null && !this.getDatatype().equals(that.getDatatype())); } return false; }