PDPGroupContainer extends PolicyItemSetChangeNotifier implements PolicyContainer.Indexed, PolicyContainer.ItemSetChangeNotifier { @Override public Class<?> getType(Object propertyId) { if (propertyId.equals(PROPERTY_ID)) { return String.class; } if (propertyId.equals(PROPERTY_NAME)) { return String.class; } if (propertyId.equals(PROPERTY_DESCRIPTION)) { return String.class; } if (propertyId.equals(PROPERTY_DEFAULT)) { return Boolean.class; } if (propertyId.equals(PROPERTY_STATUS)) { return String.class; } if (propertyId.equals(PROPERTY_PDPS)) { return Set.class; } if (propertyId.equals(PROPERTY_POLICIES)) { return Set.class; } if (propertyId.equals(PROPERTY_PIPCONFIG)) { return Set.class; } if (propertyId.equals(PROPERTY_SELECTED)) { return Checkbox.class; } return null; } PDPGroupContainer(PAPPolicyEngine papPolicyEngine); boolean isSupported(Object itemId); synchronized void refreshGroups(); List<OnapPDPGroup> getGroups(); void makeDefault(OnapPDPGroup group); void removeGroup(OnapPDPGroup group, OnapPDPGroup newGroup); void removePDP(OnapPDP pdp, OnapPDPGroup group); void updatePDP(OnapPDP pdp); void updateGroup(OnapPDPGroup group); void updateGroup(OnapPDPGroup group, String userName); @Override Collection<?> getContainerPropertyIds(); @Override Collection<?> getItemIds(); @Override List<?> getItemIds(int startIndex, int numberOfItems); @Override Class<?> getType(Object propertyId); @Override int size(); @Override boolean containsId(Object itemId); @Override Object addItem(); void addNewGroup(String name, String description); void addNewPDP(String id, OnapPDPGroup group, String name, String description, int jmxport); void movePDP(OnapPDP pdp, OnapPDPGroup group); @Override boolean addContainerProperty(Object propertyId, Class<?> type, Object defaultValue); @Override boolean removeContainerProperty(Object propertyId); @Override boolean removeAllItems(); @Override void addItemSetChangeListener(ItemSetChangeListener listener); @Override Object nextItemId(Object itemId); @Override Object prevItemId(Object itemId); @Override Object firstItemId(); @Override Object lastItemId(); @Override boolean isFirstId(Object itemId); @Override boolean isLastId(Object itemId); @Override Object addItemAfter(Object previousItemId); @Override int indexOfId(Object itemId); @Override Object getIdByIndex(int index); @Override Object addItemAt(int index); @Override boolean removeItem(Object itemId);  }
@Test public void testGetType() { assertEquals(Boolean.class, container.getType("Default")); assertEquals(Checkbox.class, container.getType("Selected")); assertEquals(Set.class, container.getType("PDPs")); assertEquals(Set.class, container.getType("Policies")); assertEquals(Set.class, container.getType("PIP Configurations")); assertEquals(String.class, container.getType("Id")); assertEquals(String.class, container.getType("Name")); assertEquals(String.class, container.getType("Description")); assertEquals(String.class, container.getType("Status")); }