public abstract class AbstractResource extends Object implements Resource
| Modifier and Type | Field and Description |
|---|---|
protected Set<String> |
deletedPropertyNames |
protected boolean |
dirty |
protected Map<String,Object> |
dirtyProperties |
static String |
HREF_PROP_NAME |
protected Map<String,Object> |
properties |
protected Lock |
readLock |
protected ReferenceFactory |
referenceFactory |
protected Lock |
writeLock |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractResource(InternalDataStore dataStore) |
protected |
AbstractResource(InternalDataStore dataStore,
Map<String,Object> properties) |
| Modifier and Type | Method and Description |
|---|---|
protected static Map<String,Property> |
createPropertyDescriptorMap(Property... props) |
boolean |
equals(Object o) |
protected boolean |
getBoolean(BooleanProperty property) |
protected boolean |
getBooleanProperty(String key)
Returns an actual boolean value instead of a possible null Boolean value since desired usage
is to have either a true or false.
|
protected InternalDataStore |
getDataStore() |
protected Date |
getDateProperty(DateProperty key) |
protected Set<String> |
getDeletedPropertyNames() |
String |
getHref() |
protected int |
getInt(IntegerProperty property) |
protected int |
getIntProperty(String key) |
Object |
getProperty(String name) |
abstract Map<String,Property> |
getPropertyDescriptors() |
Set<String> |
getPropertyNames() |
protected <T extends Resource> |
getResourceProperty(ResourceReference<T> property) |
protected String |
getString(StringProperty property) |
protected String |
getStringProperty(String key) |
Set<String> |
getUpdatedPropertyNames() |
int |
hashCode() |
boolean |
isDirty()
Returns
true if the resource's properties have been modified in anyway since the resource instance was
created. |
protected boolean |
isMaterialized() |
protected boolean |
isNew()
Returns
true if the resource doesn't yet have an assigned 'href' property, false otherwise. |
protected boolean |
isPrintableProperty(String name)
Returns
true if the internal property is safe to print in toString(), false otherwise. |
protected void |
materialize() |
void |
setProperties(Map<String,Object> properties) |
protected void |
setProperty(Property property,
Object value) |
protected void |
setProperty(String name,
Object value) |
protected Object |
setProperty(String name,
Object value,
boolean dirty) |
protected <T extends Resource> |
setResourceProperty(ResourceReference<T> property,
Resource value) |
String |
toString() |
public static final String HREF_PROP_NAME
protected final Lock readLock
protected final Lock writeLock
protected volatile boolean dirty
protected final ReferenceFactory referenceFactory
protected AbstractResource(InternalDataStore dataStore)
protected AbstractResource(InternalDataStore dataStore, Map<String,Object> properties)
protected static Map<String,Property> createPropertyDescriptorMap(Property... props)
protected final InternalDataStore getDataStore()
protected final boolean isMaterialized()
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 createdprotected final boolean isNew()
true if the resource doesn't yet have an assigned 'href' property, false otherwise.true if the resource doesn't yet have an assigned 'href' property, false otherwise.protected void materialize()
protected String getString(StringProperty property)
protected Date getDateProperty(DateProperty key)
protected int getInt(IntegerProperty property)
protected int getIntProperty(String key)
protected boolean getBoolean(BooleanProperty property)
protected boolean getBooleanProperty(String key)
protected <T extends Resource> T getResourceProperty(ResourceReference<T> property)
protected <T extends Resource> void setResourceProperty(ResourceReference<T> property, Resource value)
T - property - value - protected boolean isPrintableProperty(String name)
true if the internal property is safe to print in toString(), false otherwise.name - The name of the property to check for safe printingtrue if the internal property is safe to print in toString(), false otherwise.Copyright © 2012–2014. All rights reserved.