public abstract class ScimAttributeAware extends Object
AbstractSCIMObject that will help reading, replacing attributes from objects and also an equals
implementation of AbstractSCIMObjects is added.| Constructor and Description |
|---|
ScimAttributeAware() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addMultivaluedComplexAtribute(List<MultiValuedComplexType> multiValuedComplexTypeList,
SCIMAttributeSchema complexDefinition,
SCIMAttributeSchema valueDefinition,
SCIMAttributeSchema displayDefinition,
SCIMAttributeSchema typeDefinition,
SCIMAttributeSchema primaryDefinition,
SCIMAttributeSchema referenceDefinition)
this method will add a
MultiValuedComplexType list to the given getResource() |
static boolean |
attributeMetaEquals(Attribute attribute,
Attribute attributeOther)
tells us if the given two attributes do contain the same meta-data
|
static boolean |
attributesEquals(Attribute attribute,
Attribute attributeOther)
checks that two given attributes are equals by running through their structure recursively
|
static boolean |
complexAttributeEquals(ComplexAttribute attribute,
ComplexAttribute otherAttribute)
tells us if two complex attributes are identical or not
|
boolean |
equals(Object object)
this method is used to compare to scim objects
|
Optional<ComplexAttribute> |
getComplexAttribute(SCIMAttributeSchema scimAttributeSchema)
gets a
ComplexAttribute from the given getResource() object |
LocalDateTime |
getCreatedDateTime() |
Instant |
getCreatedInstant() |
Long |
getCreatedLong() |
String |
getExternalId() |
String |
getId() |
LocalDateTime |
getLastModifiedDateTime() |
Instant |
getLastModifiedInstant() |
Long |
getLastModifiedLong() |
String |
getLocation() |
Optional<MultiValuedAttribute> |
getMultiValuedAttribute(SCIMAttributeSchema scimAttributeSchema)
gets a
MultiValuedAttribute from the given getResource() object |
protected Optional<List<MultiValuedComplexType>> |
getMultivaluedComplexType(SCIMAttributeSchema multiValuedDefinition,
SCIMAttributeSchema valueDefinition,
SCIMAttributeSchema displayDefinition,
SCIMAttributeSchema typeDefinition,
SCIMAttributeSchema primaryDefinition,
SCIMAttributeSchema referenceDefinition)
extracts a multi-valued-complex-type from the
getResource() object by the given attribute
definitions |
ComplexAttribute |
getOrCrateComplexAttribute(SCIMAttributeSchema scimAttributeSchema)
gets a
ComplexAttribute from the given getResource() object if it does exist and will
create it if it does not exist |
abstract AbstractSCIMObject |
getResource() |
String |
getResourceType() |
protected BiConsumer<SCIMAttributeSchema,Supplier<Object>> |
getSetSubAttributeConsumer(ComplexAttribute complexAttribute)
|
Optional<SimpleAttribute> |
getSimpleAttribute(SCIMAttributeSchema scimAttributeSchema)
gets a
SimpleAttribute from the given getResource() object |
Optional<SimpleAttribute> |
getSimpleAttribute(SCIMAttributeSchema scimAttributeSchema,
ComplexAttribute complexAttribute)
gets a
SimpleAttribute from the given complexAttribute object |
Optional<String> |
getSimpleAttributeValue(SCIMAttributeSchema scimAttributeSchema,
ComplexAttribute complexAttribute)
gets a
SimpleAttribute from the given complexAttribute object |
int |
hashCode() |
protected boolean |
isBlank(String s)
tells us if this string is blank or not
|
protected boolean |
isNotBlank(String s)
tells us if this string is blank or not
|
static boolean |
multiValuedAttributeEquals(MultiValuedAttribute attribute,
MultiValuedAttribute otherAttribute)
tells us if two simple attributes are identical
|
void |
replaceCreated(Instant createdDate)
sets the created date into the given SCIM resource
|
void |
replaceCreated(LocalDateTime createdDate)
sets the created date into the given SCIM resource
|
void |
replaceCreated(Long createdTimestamp)
sets the created date into the given SCIM resource as localized date string based on the current system
time
|
void |
replaceExternalId(String externalId)
sets or overrides the external id attribute of the given
getResource() object |
void |
replaceId(String id)
sets or overrides the id attribute of the given
getResource() object |
void |
replaceLastModified(Instant lastModifiedInstant)
sets the last modified date into the given SCIM resource
|
void |
replaceLastModified(LocalDateTime lastModifiedDateTime)
sets the last modified date into the given SCIM resource
|
void |
replaceLastModified(Long lastModifiedTimestamp)
sets the last modified timestamp date into the given SCIM resource as localized date string based on the
current system time
|
void |
replaceLocation(String resourceType)
sets or overrides the location attribute of the given
getResource() object |
void |
replaceResourceType(String resourceType)
sets or overrides the resource type attribute of the given
getResource() object |
void |
replaceSimpleAttribute(SCIMAttributeSchema scimAttributeSchema,
Object value)
sets a
SimpleAttribute for the given getResource() |
static boolean |
simpleAttributeEquals(SimpleAttribute attribute1,
SimpleAttribute attribute2)
tells us if two simple attributes are identical
|
protected String |
stripToNull(String s)
returns null if this string is blank and removed all whitespaces in the front and at the rear if it is not blank
|
public String getId()
getResource()public void replaceId(String id)
getResource() objectid - the id attribute to writepublic String getExternalId()
getResource()public void replaceExternalId(String externalId)
getResource() objectexternalId - the external id attribute to writepublic String getResourceType()
getResource()public void replaceResourceType(String resourceType)
getResource() objectresourceType - the resource type attribute to writepublic String getLocation()
getResource()public void replaceLocation(String resourceType)
getResource() objectresourceType - the location attribute to writepublic Long getCreatedLong()
getResource() in UTCpublic LocalDateTime getCreatedDateTime()
LocalDateTime of the SCIM getResource()public Instant getCreatedInstant()
Instant of the SCIM getResource() in UTCpublic void replaceCreated(LocalDateTime createdDate)
createdDate - the java local date time representaitonpublic void replaceCreated(Instant createdDate)
createdDate - the java local date time representaitonpublic void replaceCreated(Long createdTimestamp)
createdTimestamp - the UTC timestamp as longpublic LocalDateTime getLastModifiedDateTime()
LocalDateTime of the SCIM getResource()public Instant getLastModifiedInstant()
LocalDateTime of the SCIM getResource() in UTCpublic Long getLastModifiedLong()
getResource() in UTCpublic void replaceLastModified(LocalDateTime lastModifiedDateTime)
lastModifiedDateTime - the java local date time representaitonpublic void replaceLastModified(Instant lastModifiedInstant)
lastModifiedInstant - the java local date time representaitonpublic void replaceLastModified(Long lastModifiedTimestamp)
lastModifiedTimestamp - the UTC timestamp as longpublic Optional<SimpleAttribute> getSimpleAttribute(SCIMAttributeSchema scimAttributeSchema)
SimpleAttribute from the given getResource() objectscimAttributeSchema - the attribute that should be read from the getResource()getResource() or an emptypublic Optional<SimpleAttribute> getSimpleAttribute(SCIMAttributeSchema scimAttributeSchema, ComplexAttribute complexAttribute)
SimpleAttribute from the given complexAttribute objectscimAttributeSchema - the attribute that should be read from the complexAttributecomplexAttribute - the attribute that should be read from the complexAttributecomplexAttribute or an emptypublic Optional<String> getSimpleAttributeValue(SCIMAttributeSchema scimAttributeSchema, ComplexAttribute complexAttribute)
SimpleAttribute from the given complexAttribute objectscimAttributeSchema - the attribute that should be read from the complexAttributecomplexAttribute - the attribute that should be read from the complexAttribute if
(scimAttributeSchema == null || complexAttribute == null) { return Optional.empty(); }complexAttribute or an emptypublic Optional<ComplexAttribute> getComplexAttribute(SCIMAttributeSchema scimAttributeSchema)
ComplexAttribute from the given getResource() objectscimAttributeSchema - the attribute that should be read from the getResource()getResource() or an emptypublic ComplexAttribute getOrCrateComplexAttribute(SCIMAttributeSchema scimAttributeSchema)
ComplexAttribute from the given getResource() object if it does exist and will
create it if it does not existscimAttributeSchema - the attribute that should be read from the getResource()getResource() or a new attribute that will also be added to the
getResource() objectpublic Optional<MultiValuedAttribute> getMultiValuedAttribute(SCIMAttributeSchema scimAttributeSchema)
MultiValuedAttribute from the given getResource() objectscimAttributeSchema - the attribute that should be read from the getResource()getResource() or an emptypublic void replaceSimpleAttribute(SCIMAttributeSchema scimAttributeSchema, Object value)
SimpleAttribute for the given getResource()scimAttributeSchema - the attribute to setvalue - the value that represents the attributeprotected void addMultivaluedComplexAtribute(List<MultiValuedComplexType> multiValuedComplexTypeList, SCIMAttributeSchema complexDefinition, SCIMAttributeSchema valueDefinition, SCIMAttributeSchema displayDefinition, SCIMAttributeSchema typeDefinition, SCIMAttributeSchema primaryDefinition, SCIMAttributeSchema referenceDefinition)
MultiValuedComplexType list to the given getResource()multiValuedComplexTypeList - the list of attributes that should be added if they are presentcomplexDefinition - the definition of the complex attribute that should be added to the
getResource()valueDefinition - the definition of the value-attribute for the given complex-typedisplayDefinition - the definition of the display-attribute for the given complex-typetypeDefinition - the definition of the type-attribute for the given complex-typeprimaryDefinition - the definition of the primary-attribute for the given complex-typereferenceDefinition - the definition of the reference-attribute for the given complex-typeprotected BiConsumer<SCIMAttributeSchema,Supplier<Object>> getSetSubAttributeConsumer(ComplexAttribute complexAttribute)
complexAttribute - the ComplexAttribute that will be extended by a SimpleAttributeSimpleAttribute to the given
ComplexAttributeprotected Optional<List<MultiValuedComplexType>> getMultivaluedComplexType(SCIMAttributeSchema multiValuedDefinition, SCIMAttributeSchema valueDefinition, SCIMAttributeSchema displayDefinition, SCIMAttributeSchema typeDefinition, SCIMAttributeSchema primaryDefinition, SCIMAttributeSchema referenceDefinition)
getResource() object by the given attribute
definitionsmultiValuedDefinition - the multi valued complex type definitionvalueDefinition - the value-definition of the multi-valued-complex typedisplayDefinition - the display-definition of the multi-valued-complex typetypeDefinition - the type-definition of the multi-valued-complex typeprimaryDefinition - the primary-definition of the multi-valued-complex typereferenceDefinition - the reference-definition of the multi-valued-complex typeMultiValuedComplexTypespublic boolean equals(Object object)
public static boolean attributesEquals(Attribute attribute, Attribute attributeOther)
public static boolean attributeMetaEquals(Attribute attribute, Attribute attributeOther)
public static boolean simpleAttributeEquals(SimpleAttribute attribute1, SimpleAttribute attribute2)
public static boolean multiValuedAttributeEquals(MultiValuedAttribute attribute, MultiValuedAttribute otherAttribute)
public static boolean complexAttributeEquals(ComplexAttribute attribute, ComplexAttribute otherAttribute)
protected boolean isBlank(String s)
protected boolean isNotBlank(String s)
protected String stripToNull(String s)
public abstract AbstractSCIMObject getResource()
Copyright © 2020 WSO2. All rights reserved.