Mercurial > hg > openmind
diff src/main/java/org/mpi/openmind/repository/bo/Relation.java @ 40:c181cb6f1761
first version of equalsStructure to test when saving entities.
author | casties |
---|---|
date | Thu, 13 Oct 2016 21:07:44 +0200 |
parents | 5737ab564b94 |
children | fc120c3c6ce4 |
line wrap: on
line diff
--- a/src/main/java/org/mpi/openmind/repository/bo/Relation.java Thu Oct 13 19:02:24 2016 +0200 +++ b/src/main/java/org/mpi/openmind/repository/bo/Relation.java Thu Oct 13 21:07:44 2016 +0200 @@ -227,20 +227,25 @@ this.targetId = targetId; } - public boolean equalsContent(Relation other){ - if(other == null){ - return false; - } - - if(StringUtils.equals(getOwnValue(), other.getOwnValue()) && - OMUtils.equals(getSourceId(), other.getSourceId()) && - OMUtils.equals(getTargetId(), other.getTargetId())){ - return true; - } - - return false; - } - + /** + * Returns if this Relation is equal to another Relation. + * + * Compares ownvalue (=type), source id and target id. + * + * @param other + * @return + */ + public boolean equalsContent(Relation other) { + if (other == null) { + return false; + } + if (StringUtils.equals(getOwnValue(), other.getOwnValue()) + && OMUtils.equals(getSourceId(), other.getSourceId()) + && OMUtils.equals(getTargetId(), other.getTargetId())) { + return true; + } + return false; + } @Override public String toString() {