@Test public void testGetFriendlyName() { String testTitle = "Get friendly name"; LOG.info("[Test] "+testTitle); String expectedFriendlyName = "Shared with the world"; String actualFriendlyName = ConditionUtils.getFriendlyName(ConditionUtils.create(ConditionConstants.SHARE_WITH_3RD_PARTIES, "1")); assertEquals("Friendly names should be equal", expectedFriendlyName, actualFriendlyName); expectedFriendlyName = "Data retention in hours"; actualFriendlyName = ConditionUtils.getFriendlyName(ConditionUtils.create(ConditionConstants.DATA_RETENTION_IN_HOURS, "1")); assertEquals("Friendly names should be equal", expectedFriendlyName, actualFriendlyName); }
public static String getFriendlyName(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition entry) { if (null == entry || null == entry.getConditionConstant()) { return ""; } if (null == map2FriendlyName || map2FriendlyName.size() <= 0) { map2FriendlyName = new HashMap<String, String>(); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.SHARE_WITH_3RD_PARTIES.name(), "Shared with the world"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.SHARE_WITH_CIS_MEMBERS_ONLY.name(), "Shared with community members"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.SHARE_WITH_CIS_OWNER_ONLY.name(), "Not shared"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.MAY_BE_INFERRED.name(), "Warning, this data may be inferred"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.DATA_RETENTION_IN_SECONDS.name(), "Data retention in seconds"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.DATA_RETENTION_IN_MINUTES.name(), "Data retention in minutes"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.DATA_RETENTION_IN_HOURS.name(), "Data retention in hours"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.RIGHT_TO_OPTOUT.name(), "Right to optout"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.STORE_IN_SECURE_STORAGE.name(), "Stored in a secure storage"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.RIGHT_TO_ACCESS_HELD_DATA.name(), "Right to access held data"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.RIGHT_TO_CORRECT_INCORRECT_DATA.name(), "Right to correct invalid data"); } if (map2FriendlyName.containsKey(entry.getConditionConstant().name())) { return map2FriendlyName.get(entry.getConditionConstant().name()); } return entry.getConditionConstant().name(); }
ConditionUtils { public static String getFriendlyName(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition entry) { if (null == entry || null == entry.getConditionConstant()) { return ""; } if (null == map2FriendlyName || map2FriendlyName.size() <= 0) { map2FriendlyName = new HashMap<String, String>(); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.SHARE_WITH_3RD_PARTIES.name(), "Shared with the world"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.SHARE_WITH_CIS_MEMBERS_ONLY.name(), "Shared with community members"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.SHARE_WITH_CIS_OWNER_ONLY.name(), "Not shared"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.MAY_BE_INFERRED.name(), "Warning, this data may be inferred"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.DATA_RETENTION_IN_SECONDS.name(), "Data retention in seconds"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.DATA_RETENTION_IN_MINUTES.name(), "Data retention in minutes"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.DATA_RETENTION_IN_HOURS.name(), "Data retention in hours"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.RIGHT_TO_OPTOUT.name(), "Right to optout"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.STORE_IN_SECURE_STORAGE.name(), "Stored in a secure storage"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.RIGHT_TO_ACCESS_HELD_DATA.name(), "Right to access held data"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.RIGHT_TO_CORRECT_INCORRECT_DATA.name(), "Right to correct invalid data"); } if (map2FriendlyName.containsKey(entry.getConditionConstant().name())) { return map2FriendlyName.get(entry.getConditionConstant().name()); } return entry.getConditionConstant().name(); } }
ConditionUtils { public static String getFriendlyName(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition entry) { if (null == entry || null == entry.getConditionConstant()) { return ""; } if (null == map2FriendlyName || map2FriendlyName.size() <= 0) { map2FriendlyName = new HashMap<String, String>(); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.SHARE_WITH_3RD_PARTIES.name(), "Shared with the world"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.SHARE_WITH_CIS_MEMBERS_ONLY.name(), "Shared with community members"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.SHARE_WITH_CIS_OWNER_ONLY.name(), "Not shared"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.MAY_BE_INFERRED.name(), "Warning, this data may be inferred"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.DATA_RETENTION_IN_SECONDS.name(), "Data retention in seconds"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.DATA_RETENTION_IN_MINUTES.name(), "Data retention in minutes"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.DATA_RETENTION_IN_HOURS.name(), "Data retention in hours"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.RIGHT_TO_OPTOUT.name(), "Right to optout"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.STORE_IN_SECURE_STORAGE.name(), "Stored in a secure storage"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.RIGHT_TO_ACCESS_HELD_DATA.name(), "Right to access held data"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.RIGHT_TO_CORRECT_INCORRECT_DATA.name(), "Right to correct invalid data"); } if (map2FriendlyName.containsKey(entry.getConditionConstant().name())) { return map2FriendlyName.get(entry.getConditionConstant().name()); } return entry.getConditionConstant().name(); }  }
ConditionUtils { public static String getFriendlyName(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition entry) { if (null == entry || null == entry.getConditionConstant()) { return ""; } if (null == map2FriendlyName || map2FriendlyName.size() <= 0) { map2FriendlyName = new HashMap<String, String>(); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.SHARE_WITH_3RD_PARTIES.name(), "Shared with the world"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.SHARE_WITH_CIS_MEMBERS_ONLY.name(), "Shared with community members"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.SHARE_WITH_CIS_OWNER_ONLY.name(), "Not shared"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.MAY_BE_INFERRED.name(), "Warning, this data may be inferred"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.DATA_RETENTION_IN_SECONDS.name(), "Data retention in seconds"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.DATA_RETENTION_IN_MINUTES.name(), "Data retention in minutes"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.DATA_RETENTION_IN_HOURS.name(), "Data retention in hours"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.RIGHT_TO_OPTOUT.name(), "Right to optout"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.STORE_IN_SECURE_STORAGE.name(), "Stored in a secure storage"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.RIGHT_TO_ACCESS_HELD_DATA.name(), "Right to access held data"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.RIGHT_TO_CORRECT_INCORRECT_DATA.name(), "Right to correct invalid data"); } if (map2FriendlyName.containsKey(entry.getConditionConstant().name())) { return map2FriendlyName.get(entry.getConditionConstant().name()); } return entry.getConditionConstant().name(); }  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 String getFriendlyName(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Condition entry) { if (null == entry || null == entry.getConditionConstant()) { return ""; } if (null == map2FriendlyName || map2FriendlyName.size() <= 0) { map2FriendlyName = new HashMap<String, String>(); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.SHARE_WITH_3RD_PARTIES.name(), "Shared with the world"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.SHARE_WITH_CIS_MEMBERS_ONLY.name(), "Shared with community members"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.SHARE_WITH_CIS_OWNER_ONLY.name(), "Not shared"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.MAY_BE_INFERRED.name(), "Warning, this data may be inferred"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.DATA_RETENTION_IN_SECONDS.name(), "Data retention in seconds"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.DATA_RETENTION_IN_MINUTES.name(), "Data retention in minutes"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.DATA_RETENTION_IN_HOURS.name(), "Data retention in hours"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.RIGHT_TO_OPTOUT.name(), "Right to optout"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.STORE_IN_SECURE_STORAGE.name(), "Stored in a secure storage"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.RIGHT_TO_ACCESS_HELD_DATA.name(), "Right to access held data"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ConditionConstants.RIGHT_TO_CORRECT_INCORRECT_DATA.name(), "Right to correct invalid data"); } if (map2FriendlyName.containsKey(entry.getConditionConstant().name())) { return map2FriendlyName.get(entry.getConditionConstant().name()); } return entry.getConditionConstant().name(); }  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; }