diff --git a/.gitignore b/.gitignore index 900fb00af..b0ddedc31 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ target *.iws *.ipr .idea -*DS_Store +*.DS_Store # Mobile Tools for Java (J2ME) .mtj.tmp/ diff --git a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/utils/AttributeMapper.java b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/utils/AttributeMapper.java index 47e76c2bb..7b5b20423 100644 --- a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/utils/AttributeMapper.java +++ b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/utils/AttributeMapper.java @@ -54,8 +54,7 @@ import static org.wso2.carbon.identity.scim2.common.utils.SCIMCommonConstants.SCIM_COMPLEX_MULTIVALUED_ATTRIBUTE_SUPPORT_ENABLED; /** - * This class is responsible for converting SCIM attributes in a SCIM object to - * carbon claims and vice versa. + * This class is responsible for converting SCIM attributes in a SCIM object to carbon claims and vice versa. */ public class AttributeMapper { @@ -65,8 +64,8 @@ public class AttributeMapper { /** * Return claims as a map of . * - * @param scimObject - * @return + * @param scimObject SCIM object. + * @return A map of claims. */ public static Map getClaimsMap(AbstractSCIMObject scimObject) throws CharonException { @@ -84,8 +83,10 @@ public static Map getClaimsMap(AbstractSCIMObject scimObject) th } else if (attribute instanceof MultiValuedAttribute) { setClaimsForMultivaluedAttribute(attribute, claimsMap); } else if (attribute instanceof ComplexAttribute) { - // NOTE: in carbon, we only support storing of type and value of a complex multi-valued attribute - // reading attributes list of the complex attribute + /* + NOTE: in carbon, we only support storing of type and value of a complex multi-valued attribute + reading attributes list of the complex attribute. + */ ComplexAttribute complexAttribute = (ComplexAttribute) attribute; Map attributes = null; if (complexAttribute.getSubAttributesList() != null && @@ -112,10 +113,10 @@ public static Map getClaimsMap(AbstractSCIMObject scimObject) th } /** - * set claim mapping for simple attribute. + * Set claim mapping for simple attribute. * - * @param attribute - * @param claimsMap + * @param attribute Target attribute. + * @param claimsMap A map containing claims and corresponding values to be set for the target attribute. */ private static void setClaimsForSimpleAttribute(Attribute attribute, Map claimsMap) throws CharonException { @@ -143,18 +144,18 @@ private static void setClaimsForSimpleSubAttributeOfMultivaluedComplexAttribute( } /** - * set claim mapping for multivalued attribute. + * Set claim mapping for multivalued attribute. * - * @param attribute - * @param claimsMap + * @param attribute Target attribute. + * @param claimsMap A map containing claims and corresponding values to be set for the target attribute. */ private static void setClaimsForMultivaluedAttribute(Attribute attribute, Map claimsMap) throws CharonException { MultiValuedAttribute multiValAttribute = (MultiValuedAttribute) attribute; - // get the URI of root attribute + // Get the URI of root attribute. String attributeURI = multiValAttribute.getURI(); - // check if values are set as primitive values + // Check if values are set as primitive values. List attributeValues = multiValAttribute.getAttributePrimitiveValues(); if (CollectionUtils.isNotEmpty(attributeValues)) { String values = null; @@ -195,7 +196,7 @@ private static void setClaimsForMultivaluedAttribute(Attribute attribute, Map claimsMap) throws CharonException { - // reading attributes list of the complex attribute + // Reading attributes list of the complex attribute. ComplexAttribute entryOfComplexAttribute = (ComplexAttribute) entry; Map entryAttributes; if (entryOfComplexAttribute.getSubAttributesList() != null && @@ -456,13 +457,13 @@ public static void constructSCIMObjectFromAttributesOfLevelTwo(Map.Entry subSubAttributeSchemaList = subAttributeSchema .getSubAttributeSchemas(); for (AttributeSchema subSubAttributeSchema : subSubAttributeSchemaList) { @@ -815,10 +819,10 @@ private static AttributeSchema getAttributeSchema(String attributeURI, int scimO } /** - * return the corresponding resource type schema. + * Return the corresponding resource type schema. * - * @param scimObjectType - * @return + * @param scimObjectType SCIM object type. + * @return Resource type schema of the given SCIM object type. */ private static ResourceTypeSchema getResourceSchema(int scimObjectType) {