@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; //AttributeDefs are checked in the super if (!super.equals(o)) return false; AtlasRelationshipDef that = (AtlasRelationshipDef) o; if (!Objects.equals(relationshipCategory, that.getRelationshipCategory())) return false; if (!Objects.equals(propagateTags, that.getPropagateTags())) return false; if (!Objects.equals(endDef1, that.getEndDef1())) return false; return (Objects.equals(endDef2, that.getEndDef2())); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; //AttributeDefs are checked in the super if (!super.equals(o)) return false; AtlasRelationshipDef that = (AtlasRelationshipDef) o; if (!Objects.equals(relationshipCategory, that.getRelationshipCategory())) return false; if (!Objects.equals(propagateTags, that.getPropagateTags())) return false; if (!Objects.equals(endDef1, that.getEndDef1())) return false; return (Objects.equals(endDef2, that.getEndDef2())); }
public AtlasRelationshipDef(AtlasRelationshipDef other) throws AtlasBaseException { super(other); if (other != null) { setRelationshipCategory(other.getRelationshipCategory()); setPropagateTags(other.getPropagateTags()); setEndDef1(other.getEndDef1()); setEndDef2(other.getEndDef2()); } } @Override
public AtlasRelationshipDef(AtlasRelationshipDef other) throws AtlasBaseException { super(other); if (other != null) { setRelationshipCategory(other.getRelationshipCategory()); setPropagateTags(other.getPropagateTags()); setEndDef1(other.getEndDef1()); setEndDef2(other.getEndDef2()); } } @Override
public static void setVertexPropertiesFromRelationshipDef(AtlasRelationshipDef relationshipDef, AtlasVertex vertex) { vertex.setProperty(Constants.RELATIONSHIPTYPE_END1_KEY, AtlasType.toJson(relationshipDef.getEndDef1())); vertex.setProperty(Constants.RELATIONSHIPTYPE_END2_KEY, AtlasType.toJson(relationshipDef.getEndDef2())); // default the relationship category to association if it has not been specified. String relationshipCategory = RelationshipCategory.ASSOCIATION.name(); if (relationshipDef.getRelationshipCategory()!=null) { relationshipCategory =relationshipDef.getRelationshipCategory().name(); } // Update RelationshipCategory vertex.setProperty(Constants.RELATIONSHIPTYPE_CATEGORY_KEY, relationshipCategory); if (relationshipDef.getPropagateTags() == null) { vertex.setProperty(Constants.RELATIONSHIPTYPE_TAG_PROPAGATION_KEY, AtlasRelationshipDef.PropagateTags.NONE.name()); } else { vertex.setProperty(Constants.RELATIONSHIPTYPE_TAG_PROPAGATION_KEY, relationshipDef.getPropagateTags().name()); } }
public static void setVertexPropertiesFromRelationshipDef(AtlasRelationshipDef relationshipDef, AtlasVertex vertex) { vertex.setProperty(Constants.RELATIONSHIPTYPE_END1_KEY, AtlasType.toJson(relationshipDef.getEndDef1())); vertex.setProperty(Constants.RELATIONSHIPTYPE_END2_KEY, AtlasType.toJson(relationshipDef.getEndDef2())); // default the relationship category to association if it has not been specified. String relationshipCategory = RelationshipCategory.ASSOCIATION.name(); if (relationshipDef.getRelationshipCategory()!=null) { relationshipCategory =relationshipDef.getRelationshipCategory().name(); } // Update RelationshipCategory vertex.setProperty(Constants.RELATIONSHIPTYPE_CATEGORY_KEY, relationshipCategory); if (relationshipDef.getPropagateTags() == null) { vertex.setProperty(Constants.RELATIONSHIPTYPE_TAG_PROPAGATION_KEY, AtlasRelationshipDef.PropagateTags.NONE.name()); } else { vertex.setProperty(Constants.RELATIONSHIPTYPE_TAG_PROPAGATION_KEY, relationshipDef.getPropagateTags().name()); } }
RelationshipCategory existingRelationshipCategory = existingRelationshipDef.getRelationshipCategory(); RelationshipCategory newRelationshipCategory = newRelationshipDef.getRelationshipCategory();
RelationshipCategory existingRelationshipCategory = existingRelationshipDef.getRelationshipCategory(); RelationshipCategory newRelationshipCategory = newRelationshipDef.getRelationshipCategory();
RelationshipCategory relationshipCategory = relationshipDef.getRelationshipCategory(); String name = relationshipDef.getName(); boolean isContainer1 = endDef1.getIsContainer();
RelationshipCategory relationshipCategory = relationshipDef.getRelationshipCategory(); String name = relationshipDef.getName();