public abstract class AbstractResource extends AbstractPropertyRetriever implements Resource
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
properties |
readLock, writeLock| Modifier | Constructor and Description |
|---|---|
protected |
AbstractResource(InternalDataStore dataStore) |
protected |
AbstractResource(InternalDataStore dataStore,
java.util.Map<java.lang.String,java.lang.Object> properties) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
protected static java.util.Map<java.lang.String,Property> |
createPropertyDescriptorMap(java.util.Map<java.lang.String,Property> existingProperties,
Property... props) |
protected static java.util.Map<java.lang.String,Property> |
createPropertyDescriptorMap(Property... props) |
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> |
entrySet() |
boolean |
equals(java.lang.Object o) |
java.lang.Object |
get(java.lang.Object key) |
protected InternalDataStore |
getDataStore() |
protected java.util.Set<java.lang.String> |
getDeletedPropertyNames() |
protected java.util.Map<java.lang.String,java.lang.Object> |
getInternalProperties() |
protected java.util.Map<java.lang.String,java.lang.String> |
getParamsFromHref(java.lang.String templateUrl)
Parses path parameters from URL based on a template string.
|
java.lang.Object |
getProperty(java.lang.String name) |
abstract java.util.Map<java.lang.String,Property> |
getPropertyDescriptors() |
java.util.Set<java.lang.String> |
getPropertyNames() |
java.lang.String |
getResourceHref() |
protected java.util.List |
getResourceListProperty(ResourceListProperty property)
Returns the
List property identified by key |
protected <T extends Resource> |
getResourceProperty(ResourceReference<T> property) |
java.util.Set<java.lang.String> |
getUpdatedPropertyNames() |
int |
hashCode() |
boolean |
hasProperty(java.lang.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(java.lang.String name)
Returns
true if the internal property is safe to print in toString(), false otherwise. |
java.util.Set<java.lang.String> |
keySet() |
void |
materialize() |
java.lang.Object |
put(java.lang.String key,
java.lang.Object value) |
void |
putAll(java.util.Map<? extends java.lang.String,?> m) |
java.lang.Object |
remove(java.lang.Object key) |
void |
setInternalProperties(java.util.Map<java.lang.String,java.lang.Object> properties) |
protected void |
setProperty(Property property,
java.lang.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 java.lang.Object |
setProperty(java.lang.String name,
java.lang.Object value,
boolean dirty) |
void |
setResourceHref(java.lang.String href) |
int |
size() |
java.lang.String |
toString() |
java.util.Collection<java.lang.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, java.util.Map<java.lang.String,java.lang.Object> properties)
protected static java.util.Map<java.lang.String,Property> createPropertyDescriptorMap(Property... props)
protected static java.util.Map<java.lang.String,Property> createPropertyDescriptorMap(java.util.Map<java.lang.String,Property> existingProperties, Property... props)
public abstract java.util.Map<java.lang.String,Property> getPropertyDescriptors()
public void setInternalProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
public java.lang.String getResourceHref()
getResourceHref in interface Resourcepublic void setResourceHref(java.lang.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 java.util.Set<java.lang.String> getPropertyNames()
public java.util.Set<java.lang.String> getUpdatedPropertyNames()
protected java.util.Set<java.lang.String> getDeletedPropertyNames()
public java.lang.Object getProperty(java.lang.String name)
getProperty in class AbstractPropertyRetrieverpublic boolean hasProperty(java.lang.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 java.lang.Object setProperty(java.lang.String name,
java.lang.Object value,
boolean dirty)
setProperty in class AbstractPropertyRetrieverprotected void setProperty(Property property, java.lang.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 java.util.List getResourceListProperty(ResourceListProperty property)
List property identified by keyproperty - identifierpropertypublic java.lang.String toString()
toString in class java.lang.Objectprotected boolean isPrintableProperty(java.lang.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.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectprotected java.util.Map<java.lang.String,java.lang.Object> getInternalProperties()
getInternalProperties in class AbstractPropertyRetrieverpublic int size()
public boolean isEmpty()
public boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)
public java.lang.Object get(java.lang.Object key)
public java.lang.Object put(java.lang.String key,
java.lang.Object value)
public java.lang.Object remove(java.lang.Object key)
public void putAll(java.util.Map<? extends java.lang.String,?> m)
public void clear()
public java.util.Set<java.lang.String> keySet()
public java.util.Collection<java.lang.Object> values()
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
protected java.util.Map<java.lang.String,java.lang.String> getParamsFromHref(java.lang.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-2021 Okta. All Rights Reserved.