public abstract class AbstractResource extends AbstractPropertyRetriever implements Resource
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
properties |
readLock, writeLock| Modifier | Constructor and Description |
|---|---|
protected |
AbstractResource(InternalDataStore dataStore) |
protected |
AbstractResource(InternalDataStore dataStore,
Map<String,Object> properties) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
protected static Map<String,Property> |
createPropertyDescriptorMap(Map<String,Property> existingProperties,
Property... props) |
protected static Map<String,Property> |
createPropertyDescriptorMap(Property... props) |
Set<Map.Entry<String,Object>> |
entrySet() |
boolean |
equals(Object o) |
Object |
get(Object key) |
protected InternalDataStore |
getDataStore() |
protected Set<String> |
getDeletedPropertyNames() |
protected Map<String,Object> |
getInternalProperties() |
protected Map<String,String> |
getParamsFromHref(String templateUrl)
Parses path parameters from URL based on a template string.
|
Object |
getProperty(String name) |
abstract Map<String,Property> |
getPropertyDescriptors() |
Set<String> |
getPropertyNames() |
String |
getResourceHref() |
protected List |
getResourceListProperty(ResourceListProperty property)
Returns the
List property identified by key |
protected <T extends Resource> |
getResourceProperty(ResourceReference<T> property) |
Set<String> |
getUpdatedPropertyNames() |
int |
hashCode() |
boolean |
hasProperty(String name)
Returns
true if this resource has a property with the specified name, false otherwise. |
boolean |
isDirty()
Returns
true if the resource's properties have been modified in anyway since the resource instance was
created. |
boolean |
isEmpty() |
protected boolean |
isPrintableProperty(String name)
Returns
true if the internal property is safe to print in toString(), false otherwise. |
Set<String> |
keySet() |
void |
materialize() |
Object |
put(String key,
Object value) |
void |
putAll(Map<? extends String,?> m) |
Object |
remove(Object key) |
void |
setInternalProperties(Map<String,Object> properties) |
protected void |
setProperty(Property property,
Object value,
boolean dirty,
boolean isNullable)
Use this method and the set the isNullable flag to true, to set the value to
null for the Property.
|
protected Object |
setProperty(String name,
Object value,
boolean dirty) |
void |
setResourceHref(String href) |
int |
size() |
String |
toString() |
Collection<Object> |
values() |
getBoolean, getBoolean, getBooleanProperty, getCharArray, getDateProperty, getDoubleProperty, getDoubleProperty, getEnumListProperty, getEnumProperty, getEnumProperty, getInt, getInteger, getIntegerList, getIntProperty, getIntProperty, getListProperty, getListProperty, getMap, getMapProperty, getNonEmptyMap, getNullableBoolean, getNullableBooleanProperty, getNumber, getNumberList, getString, getString, getStringList, getStringProperty, setProperty, setPropertyprotected AbstractResource(InternalDataStore dataStore)
protected AbstractResource(InternalDataStore dataStore, Map<String,Object> properties)
protected static Map<String,Property> createPropertyDescriptorMap(Property... props)
protected static Map<String,Property> createPropertyDescriptorMap(Map<String,Property> existingProperties, Property... props)
public String getResourceHref()
getResourceHref in interface Resourcepublic void setResourceHref(String href)
setResourceHref in interface Resourceprotected final InternalDataStore getDataStore()
public final boolean isDirty()
true if the resource's properties have been modified in anyway since the resource instance was
created.true true if the resource's properties have been modified in anyway since the resource
instance was createdpublic void materialize()
public Object getProperty(String name)
getProperty in class AbstractPropertyRetrieverpublic boolean hasProperty(String name)
true if this resource has a property with the specified name, false otherwise.name - the name of the property to check for existencetrue if this resource has a property with the specified name, false otherwise.protected Object setProperty(String name, Object value, boolean dirty)
setProperty in class AbstractPropertyRetrieverprotected void setProperty(Property property, Object value, boolean dirty, boolean isNullable)
property - the key of the value to setvalue - the actual value to be setdirty - mark the object as dirty if trueisNullable - true if the value can be set to nullprotected <T extends Resource> T getResourceProperty(ResourceReference<T> property)
protected List getResourceListProperty(ResourceListProperty property)
List property identified by keyproperty - identifierpropertyprotected boolean isPrintableProperty(String name)
true if the internal property is safe to print in toString(), false otherwise.isPrintableProperty in class AbstractPropertyRetrievername - The name of the property to check for safe printingtrue if the internal property is safe to print in toString(), false otherwise.protected Map<String,Object> getInternalProperties()
getInternalProperties in class AbstractPropertyRetrieverpublic int size()
public boolean isEmpty()
public boolean containsKey(Object key)
public boolean containsValue(Object value)
public void clear()
public Collection<Object> values()
protected Map<String,String> getParamsFromHref(String templateUrl)
Example:
For the template string: /users/{userId}/favorite/{iceCream}, and the href of this resource:
/users/42/favorite/vanilla}, the resulting map would be: [userId: 42, iceCream: vanilla].
templateUrl - template of the URL to parseCopyright © 2017–2022 Okta. All rights reserved.