Package com.globalmentor.model
Class DefaultObjectState<T>
- java.lang.Object
-
- com.globalmentor.beans.BoundPropertyObject
-
- com.globalmentor.model.DefaultModifiable
-
- com.globalmentor.model.DefaultObjectState<T>
-
- Type Parameters:
T
- The type of object the state of which is being stored.
- All Implemented Interfaces:
PropertyBindable
,PropertyConstrainable
,Modifiable
,ObjectState<T>
public class DefaultObjectState<T> extends DefaultModifiable implements ObjectState<T>
Deprecated.A default implementation of object state information.Each property changed using
setProperty
will fire a property change event if its key is a string.- Author:
- Garret Wilson
- See Also:
Modifiable.MODIFIED_PROPERTY
,PropertyChangeEvent
-
-
Field Summary
-
Fields inherited from class com.globalmentor.beans.BoundPropertyObject
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
-
Fields inherited from interface com.globalmentor.model.Modifiable
MODIFIED_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description DefaultObjectState(T object)
Deprecated.Constructs an object state with an object.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(java.lang.Object object)
Deprecated.Compares object states by comparing their respective objects.T
getObject()
Deprecated.java.lang.Object
getProperty(java.lang.Object key)
Deprecated.Gets a property of the object state.int
hashCode()
Deprecated.java.lang.Object
removeProperty(java.lang.Object key)
Deprecated.Removes a property of the object state.void
setObject(T object)
Deprecated.Sets the object being described.java.lang.Object
setProperty(java.lang.Object key, java.lang.Object value)
Deprecated.Sets the value of an object state property, and fires a property changed event if the key is a string.-
Methods inherited from class com.globalmentor.model.DefaultModifiable
isModified, setModified
-
Methods inherited from class com.globalmentor.beans.BoundPropertyObject
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.globalmentor.model.Modifiable
isModified, setModified
-
Methods inherited from interface com.globalmentor.model.ObjectState
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Constructor Detail
-
DefaultObjectState
public DefaultObjectState(T object)
Deprecated.Constructs an object state with an object.- Parameters:
object
- The non-null
object being described- Throws:
java.lang.NullPointerException
- Thrown if the object isnull
.
-
-
Method Detail
-
getObject
public T getObject()
Deprecated.- Specified by:
getObject
in interfaceObjectState<T>
- Returns:
- The non-
null
object being described.
-
setObject
public void setObject(T object)
Deprecated.Sets the object being described.- Parameters:
object
- The new object to describe.- Throws:
java.lang.NullPointerException
- Thrown if the object isnull
.
-
getProperty
public java.lang.Object getProperty(java.lang.Object key)
Deprecated.Gets a property of the object state.- Specified by:
getProperty
in interfaceObjectState<T>
- Parameters:
key
- The key to the property.- Returns:
- The value of the object state's property, or
null
if that property does not exist.
-
setProperty
public java.lang.Object setProperty(java.lang.Object key, java.lang.Object value)
Deprecated.Sets the value of an object state property, and fires a property changed event if the key is a string. If the property represented by the key already exists, it will be replaced.- Specified by:
setProperty
in interfaceObjectState<T>
- Parameters:
key
- The non-null
property key.value
- The property value.- Returns:
- The old property value associated with the key, or
null
if no value was associated with the key previously. - See Also:
PropertyChangeEvent
-
removeProperty
public java.lang.Object removeProperty(java.lang.Object key)
Deprecated.Removes a property of the object state. If the property represented by the key does not exist, no action is taken.- Specified by:
removeProperty
in interfaceObjectState<T>
- Parameters:
key
- The non-null
property key.- Returns:
- The removed property value, or
null
if there was no property.
-
equals
public boolean equals(java.lang.Object object)
Deprecated.Compares object states by comparing their respective objects.- Overrides:
equals
in classjava.lang.Object
- Parameters:
object
- The object with which to compare this RDF resource; should be another object state.- Returns:
true
if this object state refers to the same object as specified in the object stateobject
.- See Also:
ObjectState
,getObject()
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- The hashcode value of the object represented.
-
-