@Test public void testGetFriendlyName() { String testTitle = "Get friendly name"; LOG.info("[Test] "+testTitle); String expectedFriendlyName = "access"; String actualFriendlyName = ActionUtils.getFriendlyName(ActionUtils.create(ActionConstants.READ)); assertEquals("Friendly names should be equal", expectedFriendlyName, actualFriendlyName); String expectedFriendlyDescription1 = "access"; String actualFriendlyDescription1 = ActionUtils.getFriendlyDescription(ActionUtils.createList(ActionConstants.READ)); assertEquals("Friendly descriptions 1 should be equal", expectedFriendlyDescription1, actualFriendlyDescription1); String expectedFriendlyDescription2 = "access and update"; String actualFriendlyDescription2 = ActionUtils.getFriendlyDescription(ActionUtils.createList(ActionConstants.READ, ActionConstants.WRITE)); assertEquals("Friendly descriptions 2 should be equal", expectedFriendlyDescription2, actualFriendlyDescription2); String expectedFriendlyDescription3 = "access, update and delete"; String actualFriendlyDescription3 = ActionUtils.getFriendlyDescription(ActionUtils.createList(ActionConstants.READ, ActionConstants.WRITE, ActionConstants.DELETE)); assertEquals("Friendly descriptions 3 should be equal", expectedFriendlyDescription3, actualFriendlyDescription3); }
public static String getFriendlyName(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action entry) { if (null == entry || null == entry.getActionConstant()) { return ""; } if (null == map2FriendlyName || map2FriendlyName.size() <= 0) { map2FriendlyName = new HashMap<String, String>(); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.READ.name(), "access"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.WRITE.name(), "update"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.CREATE.name(), "create"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.DELETE.name(), "delete"); } if (map2FriendlyName.containsKey(entry.getActionConstant().name())) { return map2FriendlyName.get(entry.getActionConstant().name()); } return entry.getActionConstant().name(); }
ActionUtils { public static String getFriendlyName(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action entry) { if (null == entry || null == entry.getActionConstant()) { return ""; } if (null == map2FriendlyName || map2FriendlyName.size() <= 0) { map2FriendlyName = new HashMap<String, String>(); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.READ.name(), "access"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.WRITE.name(), "update"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.CREATE.name(), "create"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.DELETE.name(), "delete"); } if (map2FriendlyName.containsKey(entry.getActionConstant().name())) { return map2FriendlyName.get(entry.getActionConstant().name()); } return entry.getActionConstant().name(); } }
ActionUtils { public static String getFriendlyName(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action entry) { if (null == entry || null == entry.getActionConstant()) { return ""; } if (null == map2FriendlyName || map2FriendlyName.size() <= 0) { map2FriendlyName = new HashMap<String, String>(); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.READ.name(), "access"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.WRITE.name(), "update"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.CREATE.name(), "create"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.DELETE.name(), "delete"); } if (map2FriendlyName.containsKey(entry.getActionConstant().name())) { return map2FriendlyName.get(entry.getActionConstant().name()); } return entry.getActionConstant().name(); }  }
ActionUtils { public static String getFriendlyName(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action entry) { if (null == entry || null == entry.getActionConstant()) { return ""; } if (null == map2FriendlyName || map2FriendlyName.size() <= 0) { map2FriendlyName = new HashMap<String, String>(); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.READ.name(), "access"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.WRITE.name(), "update"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.CREATE.name(), "create"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.DELETE.name(), "delete"); } if (map2FriendlyName.containsKey(entry.getActionConstant().name())) { return map2FriendlyName.get(entry.getActionConstant().name()); } return entry.getActionConstant().name(); }  static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action create(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants actionConstant); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action create(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants actionConstant, boolean optional); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action create(String actionConstantValue, boolean optional); static List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> createList(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants... actionConstants); static String getFriendlyName(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action entry); static List<String> getFriendlyName(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> haystack); static String getFriendlyDescription(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> haystack); static String getFriendlyDescription(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> haystack, boolean displayOptionalString); static String toXmlString(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action action); static String toXmlString(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> actions); static String toString(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action action); static String toString(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> actions); static boolean atLeast1MandatoryAction(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> actions); static boolean equal(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action o1, Object o2, boolean dontCheckOptional); @Deprecated static boolean equals(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action o1, Object o2); static boolean equal(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action o1, Object o2); static boolean equal(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> o1, Object o2); @Deprecated static boolean equals(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> o1, Object o2); static boolean contain(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action needle, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> haystack); static boolean contains(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action needle, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> haystack); static boolean containAllMandotory(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> needles, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> haystack); static boolean contains(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> actionsToCheck, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> actions); static boolean contains(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> actionsToCheck, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> actions, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> intersection); static boolean containsOr(List<Action> actionsToCheck, List<Action> actions); static List<Action> intersect(List<Action> actionsToCheck, List<Action> actions); static Action toAction(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action actionBean); static List<Action> toActions(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> actionBeans); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action toActionBean(Action action); static List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> toActionBeans(List<Action> actions); }
ActionUtils { public static String getFriendlyName(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action entry) { if (null == entry || null == entry.getActionConstant()) { return ""; } if (null == map2FriendlyName || map2FriendlyName.size() <= 0) { map2FriendlyName = new HashMap<String, String>(); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.READ.name(), "access"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.WRITE.name(), "update"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.CREATE.name(), "create"); map2FriendlyName.put(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants.DELETE.name(), "delete"); } if (map2FriendlyName.containsKey(entry.getActionConstant().name())) { return map2FriendlyName.get(entry.getActionConstant().name()); } return entry.getActionConstant().name(); }  static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action create(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants actionConstant); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action create(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants actionConstant, boolean optional); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action create(String actionConstantValue, boolean optional); static List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> createList(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.ActionConstants... actionConstants); static String getFriendlyName(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action entry); static List<String> getFriendlyName(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> haystack); static String getFriendlyDescription(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> haystack); static String getFriendlyDescription(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> haystack, boolean displayOptionalString); static String toXmlString(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action action); static String toXmlString(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> actions); static String toString(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action action); static String toString(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> actions); static boolean atLeast1MandatoryAction(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> actions); static boolean equal(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action o1, Object o2, boolean dontCheckOptional); @Deprecated static boolean equals(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action o1, Object o2); static boolean equal(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action o1, Object o2); static boolean equal(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> o1, Object o2); @Deprecated static boolean equals(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> o1, Object o2); static boolean contain(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action needle, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> haystack); static boolean contains(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action needle, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> haystack); static boolean containAllMandotory(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> needles, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> haystack); static boolean contains(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> actionsToCheck, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> actions); static boolean contains(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> actionsToCheck, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> actions, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> intersection); static boolean containsOr(List<Action> actionsToCheck, List<Action> actions); static List<Action> intersect(List<Action> actionsToCheck, List<Action> actions); static Action toAction(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action actionBean); static List<Action> toActions(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> actionBeans); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action toActionBean(Action action); static List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Action> toActionBeans(List<Action> actions); static Map<String, String> map2FriendlyName; }