@Test public void testGetDataTypesWithScheme() { RequestPolicy privacyPolicy = null; DataIdentifierScheme schemeFilter = DataIdentifierScheme.CONTEXT; List<String> dataTypes = PrivacyPolicyUtils.getDataTypes(schemeFilter, privacyPolicy); assertNull("Data type list of an null privacy policy should be null", dataTypes); privacyPolicy = new RequestPolicy(); dataTypes = PrivacyPolicyUtils.getDataTypes(schemeFilter, privacyPolicy); assertNull("Data type list of an empty privacy policy should be null", dataTypes); List<RequestItem> requestItems = new ArrayList<RequestItem>(); List<Condition> conditions = new ArrayList<Condition>(); conditions.add(ConditionUtils.create(ConditionConstants.SHARE_WITH_3RD_PARTIES, "Yes")); requestItems.add(RequestItemUtils.create(ResourceUtils.create(DataIdentifierScheme.CONTEXT, CtxAttributeTypes.ABOUT), ActionUtils.createList(ActionConstants.READ), conditions)); privacyPolicy.setRequestItems(requestItems); dataTypes = PrivacyPolicyUtils.getDataTypes(schemeFilter, privacyPolicy); assertNotNull("Data type list of an empty privacy policy should be null", dataTypes); }
public static List<String> getDataTypes(RequestPolicy privacyPolicy) { List<String> dataTypes = null; if (null == privacyPolicy || null == privacyPolicy.getRequestItems() || privacyPolicy.getRequestItems().size() <= 0) { return dataTypes; } dataTypes = new ArrayList<String>(); for(RequestItem requestItem : privacyPolicy.getRequestItems()) { dataTypes.add(ResourceUtils.getDataType(requestItem.getResource())); } return dataTypes; }
PrivacyPolicyUtils { public static List<String> getDataTypes(RequestPolicy privacyPolicy) { List<String> dataTypes = null; if (null == privacyPolicy || null == privacyPolicy.getRequestItems() || privacyPolicy.getRequestItems().size() <= 0) { return dataTypes; } dataTypes = new ArrayList<String>(); for(RequestItem requestItem : privacyPolicy.getRequestItems()) { dataTypes.add(ResourceUtils.getDataType(requestItem.getResource())); } return dataTypes; } }
PrivacyPolicyUtils { public static List<String> getDataTypes(RequestPolicy privacyPolicy) { List<String> dataTypes = null; if (null == privacyPolicy || null == privacyPolicy.getRequestItems() || privacyPolicy.getRequestItems().size() <= 0) { return dataTypes; } dataTypes = new ArrayList<String>(); for(RequestItem requestItem : privacyPolicy.getRequestItems()) { dataTypes.add(ResourceUtils.getDataType(requestItem.getResource())); } return dataTypes; }  }
PrivacyPolicyUtils { public static List<String> getDataTypes(RequestPolicy privacyPolicy) { List<String> dataTypes = null; if (null == privacyPolicy || null == privacyPolicy.getRequestItems() || privacyPolicy.getRequestItems().size() <= 0) { return dataTypes; } dataTypes = new ArrayList<String>(); for(RequestItem requestItem : privacyPolicy.getRequestItems()) { dataTypes.add(ResourceUtils.getDataType(requestItem.getResource())); } return dataTypes; }  static RequestPolicy inferPrivacyPolicy(PrivacyPolicyTypeConstants privacyPolicyType, Map configuration); static RequestPolicy inferCisPrivacyPolicy(
			PrivacyPolicyBehaviourConstants globalBehaviour,
			MembershipCrit membershipCriteria,
			Map<String, String> configuration); static RequestPolicy inferCisPrivacyPolicy(
			PrivacyPolicyBehaviourConstants globalBehaviour,
			MembershipCrit membershipCriteria); static RequestPolicy infer3pServicePrivacyPolicy(
			Map<String, String> configuration); static List<String> getDataTypes(RequestPolicy privacyPolicy); static List<String> getDataTypes(DataIdentifierScheme schemeFilter, RequestPolicy privacyPolicy); static String toXacmlString(RequestPolicy privacyPolicy); @Deprecated static String toXmlString(RequestPolicy privacyPolicy); static RequestPolicy fromXacmlString(String xmlPrivacyPolicy); }
PrivacyPolicyUtils { public static List<String> getDataTypes(RequestPolicy privacyPolicy) { List<String> dataTypes = null; if (null == privacyPolicy || null == privacyPolicy.getRequestItems() || privacyPolicy.getRequestItems().size() <= 0) { return dataTypes; } dataTypes = new ArrayList<String>(); for(RequestItem requestItem : privacyPolicy.getRequestItems()) { dataTypes.add(ResourceUtils.getDataType(requestItem.getResource())); } return dataTypes; }  static RequestPolicy inferPrivacyPolicy(PrivacyPolicyTypeConstants privacyPolicyType, Map configuration); static RequestPolicy inferCisPrivacyPolicy(
			PrivacyPolicyBehaviourConstants globalBehaviour,
			MembershipCrit membershipCriteria,
			Map<String, String> configuration); static RequestPolicy inferCisPrivacyPolicy(
			PrivacyPolicyBehaviourConstants globalBehaviour,
			MembershipCrit membershipCriteria); static RequestPolicy infer3pServicePrivacyPolicy(
			Map<String, String> configuration); static List<String> getDataTypes(RequestPolicy privacyPolicy); static List<String> getDataTypes(DataIdentifierScheme schemeFilter, RequestPolicy privacyPolicy); static String toXacmlString(RequestPolicy privacyPolicy); @Deprecated static String toXmlString(RequestPolicy privacyPolicy); static RequestPolicy fromXacmlString(String xmlPrivacyPolicy);  }