@Test public void testGetDataIdentifier() { String testTitle = "GetDataIdentifier"; LOG.info(testTitle); DataIdentifier actualDataId = null; try { actualDataId = ResourceUtils.getDataIdentifier(ResourceUtils.create(DataIdentifierScheme.CONTEXT, CtxAttributeTypes.ABOUT)); assertNotNull("Data id should not be null", actualDataId); assertEquals("Data id should be equals to: "+DataIdentifierScheme.CONTEXT.name(), DataIdentifierScheme.CONTEXT.name(), actualDataId.getScheme().name()); assertNotNull("Data id scheme should not be null", actualDataId.getScheme()); assertNotNull("Data id type should not be null", actualDataId.getType()); assertEquals("Data id type should be equals to: "+CtxAttributeTypes.ABOUT, CtxAttributeTypes.ABOUT, actualDataId.getType()); } catch (MalformedCtxIdentifierException e) { fail("MalformedCtxIdentifierException"); e.printStackTrace(); } String typeCisMemberList = "cis-member-list"; try { actualDataId = ResourceUtils.getDataIdentifier(ResourceUtils.create(DataIdentifierScheme.CIS, typeCisMemberList)); assertNotNull("Data id should not be null", actualDataId); assertEquals("Data id should be equals to: "+DataIdentifierScheme.CIS.name(), DataIdentifierScheme.CIS.name(), actualDataId.getScheme().name()); assertNotNull("Data id scheme should not be null", actualDataId.getScheme()); assertNotNull("Data id type should not be null", actualDataId.getType()); assertEquals("Data id type should be equals to: "+typeCisMemberList, typeCisMemberList, actualDataId.getType()); } catch (MalformedCtxIdentifierException e) { fail("MalformedCtxIdentifierException"); e.printStackTrace(); } try { actualDataId = ResourceUtils.getDataIdentifier(ResourceUtils.create(DataIdentifierUtils.toUriString(DataIdentifierScheme.CIS, typeCisMemberList))); assertNotNull("Data id should not be null", actualDataId); assertEquals("Data id should be equals to: "+DataIdentifierScheme.CIS.name(), DataIdentifierScheme.CIS.name(), actualDataId.getScheme().name()); assertNotNull("Data id scheme should not be null", actualDataId.getScheme()); assertNotNull("Data id type should not be null", actualDataId.getType()); assertEquals("Data id type should be equals to: "+typeCisMemberList, typeCisMemberList, actualDataId.getType()); } catch (MalformedCtxIdentifierException e) { fail("MalformedCtxIdentifierException"); e.printStackTrace(); } }
public static DataIdentifier getDataIdentifier(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource resource) throws MalformedCtxIdentifierException { if (null == resource.getDataIdUri() || "".equals(resource.getDataIdUri())) { return DataIdentifierFactory.fromType(resource.getScheme(), resource.getDataType()); } return DataIdentifierFactory.fromUri(resource.getDataIdUri()); }
ResourceUtils { public static DataIdentifier getDataIdentifier(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource resource) throws MalformedCtxIdentifierException { if (null == resource.getDataIdUri() || "".equals(resource.getDataIdUri())) { return DataIdentifierFactory.fromType(resource.getScheme(), resource.getDataType()); } return DataIdentifierFactory.fromUri(resource.getDataIdUri()); } }
ResourceUtils { public static DataIdentifier getDataIdentifier(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource resource) throws MalformedCtxIdentifierException { if (null == resource.getDataIdUri() || "".equals(resource.getDataIdUri())) { return DataIdentifierFactory.fromType(resource.getScheme(), resource.getDataType()); } return DataIdentifierFactory.fromUri(resource.getDataIdUri()); }  }
ResourceUtils { public static DataIdentifier getDataIdentifier(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource resource) throws MalformedCtxIdentifierException { if (null == resource.getDataIdUri() || "".equals(resource.getDataIdUri())) { return DataIdentifierFactory.fromType(resource.getScheme(), resource.getDataType()); } return DataIdentifierFactory.fromUri(resource.getDataIdUri()); }  static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource create(String dataIdUri); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource create(DataIdentifierScheme dataScheme, String dataType); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource create(DataIdentifier dataId); static String getDataIdUri(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource resource); static String getDataType(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource resource); static DataIdentifier getDataIdentifier(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource resource); static String toXmlString(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource resource); static String toString(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource resource); static String toString(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource> values); static boolean equal(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource o1, Object o2); @Deprecated static boolean equals(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource o1, Object o2); static boolean equal(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource> o1, Object o2); static boolean contain(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource needle, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource> haystack); static Resource toResource(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource resourceBean); static List<Resource> toResources(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource> resourceBeans); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource toResourceBean(Resource resource); static List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource> toResourceBeans(List<Resource> resources); }
ResourceUtils { public static DataIdentifier getDataIdentifier(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource resource) throws MalformedCtxIdentifierException { if (null == resource.getDataIdUri() || "".equals(resource.getDataIdUri())) { return DataIdentifierFactory.fromType(resource.getScheme(), resource.getDataType()); } return DataIdentifierFactory.fromUri(resource.getDataIdUri()); }  static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource create(String dataIdUri); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource create(DataIdentifierScheme dataScheme, String dataType); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource create(DataIdentifier dataId); static String getDataIdUri(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource resource); static String getDataType(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource resource); static DataIdentifier getDataIdentifier(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource resource); static String toXmlString(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource resource); static String toString(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource resource); static String toString(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource> values); static boolean equal(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource o1, Object o2); @Deprecated static boolean equals(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource o1, Object o2); static boolean equal(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource> o1, Object o2); static boolean contain(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource needle, List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource> haystack); static Resource toResource(org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource resourceBean); static List<Resource> toResources(List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource> resourceBeans); static org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource toResourceBean(Resource resource); static List<org.societies.api.schema.privacytrust.privacy.model.privacypolicy.Resource> toResourceBeans(List<Resource> resources);  }