@Test public void testEqual() { String testTitle = "Equal"; LOG.info("[Test] "+testTitle); Condition condition1 = null; Condition condition2 = null; RequestPolicy notCondition = null; assertTrue("Same null condition should be equal", ConditionUtils.equal(condition1, condition1)); assertTrue("Null conditions should be equal", ConditionUtils.equal(condition1, condition2)); assertTrue("Null condition and null object should be equal", ConditionUtils.equal(condition1, notCondition)); condition1 = new Condition(); condition2 = new Condition(); notCondition = new RequestPolicy(); assertTrue("Same empty condition should be equal", ConditionUtils.equal(condition1, condition1)); assertTrue("Empty conditions should be equal", ConditionUtils.equal(condition1, condition2)); assertTrue("Empty conditions should be equal (inverse)", ConditionUtils.equal(condition2, condition1)); assertFalse("Empty condition and empty object should not be equal", ConditionUtils.equal(condition1, notCondition)); condition1 = ConditionUtils.create(ConditionConstants.SHARE_WITH_3RD_PARTIES, "Yes"); assertTrue("Same condition should be equal", ConditionUtils.equal(condition1, condition1)); assertFalse("Different conditions should be equal", ConditionUtils.equal(condition1, condition2)); assertFalse("Different conditions should be equal (inverse)", ConditionUtils.equal(condition2, condition1)); condition2 = ConditionUtils.create(ConditionConstants.DATA_RETENTION_IN_HOURS, "Yes"); assertFalse("Different conditions should be equal (2)", ConditionUtils.equal(condition1, condition2)); assertFalse("Different conditions should be equal (inverse) (2)", ConditionUtils.equal(condition2, condition1)); condition2 = ConditionUtils.create(ConditionConstants.SHARE_WITH_3RD_PARTIES, "Yes", true); assertFalse("Different conditions should be equal (2)", ConditionUtils.equal(condition1, condition2)); assertFalse("Different conditions should be equal (inverse) (2)", ConditionUtils.equal(condition2, condition1)); condition2 = ConditionUtils.create(ConditionConstants.SHARE_WITH_3RD_PARTIES, "Yes"); assertTrue("Equal conditions should be equal", ConditionUtils.equal(condition1, condition2)); assertTrue("Equal conditions should be equal (inverse)", ConditionUtils.equal(condition2, condition1)); assertFalse("condition and object should not be equal", ConditionUtils.equal(condition1, notCondition)); }
public static boolean equal(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition o1, Object o2, boolean dontCheckOptional) { if (o1 == o2) { return true; } if (o2 == null) { return false; } if (o1 == null) { return false; } if (o1.getClass() != o2.getClass()) { return false; } org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition ro2 = (org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition) o2; return (ConditionConstantsUtils.equal(o1.getConditionConstant(), ro2.getConditionConstant()) && (StringUtils.equals(o1.getValue(), ro2.getValue())) && (dontCheckOptional || o1.isOptional() == ro2.isOptional()) ); }
ConditionUtils { public static boolean equal(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition o1, Object o2, boolean dontCheckOptional) { if (o1 == o2) { return true; } if (o2 == null) { return false; } if (o1 == null) { return false; } if (o1.getClass() != o2.getClass()) { return false; } org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition ro2 = (org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition) o2; return (ConditionConstantsUtils.equal(o1.getConditionConstant(), ro2.getConditionConstant()) && (StringUtils.equals(o1.getValue(), ro2.getValue())) && (dontCheckOptional || o1.isOptional() == ro2.isOptional()) ); } }
ConditionUtils { public static boolean equal(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition o1, Object o2, boolean dontCheckOptional) { if (o1 == o2) { return true; } if (o2 == null) { return false; } if (o1 == null) { return false; } if (o1.getClass() != o2.getClass()) { return false; } org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition ro2 = (org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition) o2; return (ConditionConstantsUtils.equal(o1.getConditionConstant(), ro2.getConditionConstant()) && (StringUtils.equals(o1.getValue(), ro2.getValue())) && (dontCheckOptional || o1.isOptional() == ro2.isOptional()) ); }  }
ConditionUtils { public static boolean equal(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition o1, Object o2, boolean dontCheckOptional) { if (o1 == o2) { return true; } if (o2 == null) { return false; } if (o1 == null) { return false; } if (o1.getClass() != o2.getClass()) { return false; } org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition ro2 = (org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition) o2; return (ConditionConstantsUtils.equal(o1.getConditionConstant(), ro2.getConditionConstant()) && (StringUtils.equals(o1.getValue(), ro2.getValue())) && (dontCheckOptional || o1.isOptional() == ro2.isOptional()) ); }  static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition create(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants conditionConstant, String value); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition create(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants conditionConstant, String value, boolean optional); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition createPrivate(); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition createMembersOnly(); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition createPublic(); static String toXmlString(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition condition); static String toXmlString(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> conditions); static String toString(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition condition); static String toString(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> conditions); static String getFriendlyName(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition entry); List<String> getFriendlyName(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> haystack); static boolean equal(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition o1, Object o2, boolean dontCheckOptional); @Deprecated static boolean equals(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition o1, Object o2); static boolean equal(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition o1, Object o2); static boolean equal(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> o1, Object o2); static boolean contain(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition conditionToCheck, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> conditions); static boolean containAllMandotory(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> needles, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> haystack); static Condition toCondition(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition conditionBean); static List<Condition> toConditions(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> conditionBeans); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition toConditionBean(Condition condition); static List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> toConditionBeans(List<Condition> conditions); static boolean contains(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants conditionToCheck, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> conditions); static boolean contains(Condition conditionToCheck, List<Condition> conditions); static boolean contains(List<Condition> conditionsToCheck, List<Condition> conditions); static boolean containsOr(List<Condition> conditionsToCheck, List<Condition> conditions); }
ConditionUtils { public static boolean equal(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition o1, Object o2, boolean dontCheckOptional) { if (o1 == o2) { return true; } if (o2 == null) { return false; } if (o1 == null) { return false; } if (o1.getClass() != o2.getClass()) { return false; } org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition ro2 = (org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition) o2; return (ConditionConstantsUtils.equal(o1.getConditionConstant(), ro2.getConditionConstant()) && (StringUtils.equals(o1.getValue(), ro2.getValue())) && (dontCheckOptional || o1.isOptional() == ro2.isOptional()) ); }  static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition create(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants conditionConstant, String value); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition create(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants conditionConstant, String value, boolean optional); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition createPrivate(); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition createMembersOnly(); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition createPublic(); static String toXmlString(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition condition); static String toXmlString(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> conditions); static String toString(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition condition); static String toString(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> conditions); static String getFriendlyName(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition entry); List<String> getFriendlyName(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> haystack); static boolean equal(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition o1, Object o2, boolean dontCheckOptional); @Deprecated static boolean equals(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition o1, Object o2); static boolean equal(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition o1, Object o2); static boolean equal(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> o1, Object o2); static boolean contain(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition conditionToCheck, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> conditions); static boolean containAllMandotory(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> needles, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> haystack); static Condition toCondition(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition conditionBean); static List<Condition> toConditions(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> conditionBeans); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition toConditionBean(Condition condition); static List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> toConditionBeans(List<Condition> conditions); static boolean contains(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants conditionToCheck, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition> conditions); static boolean contains(Condition conditionToCheck, List<Condition> conditions); static boolean contains(List<Condition> conditionsToCheck, List<Condition> conditions); static boolean containsOr(List<Condition> conditionsToCheck, List<Condition> conditions); static Map<String, String> map2FriendlyName; }