Class ExtensionField
java.lang.Object
org.gluu.oxtrust.model.scim2.extensions.ExtensionField
Represents the metadata of an attribute that belongs to a SCIM resource extension.
Attributes part of extensions, aka "extended attributes" or "custom attributes" have implicit characteristics equal to the defaults shown in section 2.2 of RFC 7643. In other words, all custom attributes have:
- canonicalValues: none assigned
- required: false
- caseExact: false
- mutability: readWrite
- returned: default
- uniqueness: none
- referenceTypes: none
The only "configurable" characteristics supported are:
- multivalued: true/false
- type: reference, string, datetime, decimal, and boolean (only).
These can be tweaked via oxTrust admin web console.
See also: Extension class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMaps the org.gluu.model.AttributeDataType associated to this ExtensionField (seegetType) to a member of the enumAttributeDefinition.Type.getName()org.gluu.model.attribute.AttributeDataTypegetType()booleanvoidsetDescription(String description) voidsetMultiValued(boolean multiValued) voidvoidsetType(org.gluu.model.attribute.AttributeDataType type) static StringstringValueOf(ExtensionField field, Object val) Deprecated.static ObjectvalueFromString(ExtensionField field, String val) Equivalent tovalueOf, however, a String is supplied as value.static ObjectvalueOf(ExtensionField field, Object val) Tries parsing the value passed according to the data type associated to the field
-
Constructor Details
-
ExtensionField
public ExtensionField()
-
-
Method Details
-
valueOf
Tries parsing the value passed according to the data type associated to the field- Parameters:
field- An ExtensionField instance that determines the data type expected to be receivedval- A non-null object that represents a (hopefully valid) value for this field- Returns:
- Null if the value is not consistent with the data type expected. Otherwise, the same value received is returned
-
valueFromString
Equivalent tovalueOf, however, a String is supplied as value. Here no validations on data type consistence takes place (it is expected that value passed reflects the type of the field). If the field is a DATE, a conversion from ISO format is done, nonetheless, DATE fields still remain being represented as Java strings- Parameters:
field- An ExtensionFieldval- A non-null String value- Returns:
- A value
-
stringValueOf
Deprecated.Takes an object and a ExtensionField, and returns a String (suitable for storing in LDAP). For a field data type NUMERIC, BOOLEAN or STRING, a straight string representation is returned. When it's DATE, it is converted from ISO to generalized date time format.- Parameters:
field- An instance of ExtensionFieldval- A value- Returns:
- String formated properly
-
getAttributeDefinitionType
Maps the org.gluu.model.AttributeDataType associated to this ExtensionField (see
getType) to a member of the enumAttributeDefinition.Type.The mapping is straightforward. Special case is org.gluu.model.AttributeDataType.NUMERIC mapped to
Type.DECIMAL.- Returns:
- An enum value of AttributeDefinition.Type
-
getName
-
setName
-
isMultiValued
public boolean isMultiValued() -
getType
public org.gluu.model.attribute.AttributeDataType getType() -
setMultiValued
public void setMultiValued(boolean multiValued) -
setType
public void setType(org.gluu.model.attribute.AttributeDataType type) -
getDescription
-
setDescription
-