Class Row
- All Implemented Interfaces:
RMJSONArchiver.GetKeys, RMJSONArchiver.GetValue, RMJSONArchiver.SetValue, PropertyChangeListener, Serializable, Cloneable, EventListener, Map<String,Object>
- Direct Known Subclasses:
SnapRow
public class Row
extends HashMap<String,Object>
implements PropertyChangeListener, RMJSONArchiver.GetKeys, RMJSONArchiver.GetValue, RMJSONArchiver.SetValue
Represents a data bearing object from a WebSite.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an object to a list at given index.voidAdds an object to a list at given index.voidaddPropertyChangeListener(PropertyChangeListener aListener) Add a property change listener.protected RowReturns the row this row was loaded from or the original state of this row.voiddelete()Deletes this row.booleanOverride to just check identity, since rows are unique.protected voidfirePropertyChange(String aPropName, Object anOldVal, Object aNewVal, int anIndex) Fires a property change.@Nullable ObjectReturns the current row value for key.@Nullable ObjectReturns the current row value for key.@Nullable ObjectReturns the current row value for key.Returns the entity that describes the data in this row.booleanReturns whether file exists in data source (has been saved and, if so, not deleted).RMJSONArchiver method to return keys in property order and, potentially, NewValues key.getJSONValue(String aKey) RMJSONArchiver method to get archiver values via getValue() and handle NewValues.longReturns the file modification time.Returns the original state of this row (or null if row not modified).Returns the primary property.getProperty(String aName) Returns the named property.protected ObjectReturns the current value or RowLink for a key.getSite()Returns the WebSite that created this row.Row[]Returns an array of relation rows for this row that don't have a primary key value.Returns the current row value for key.Returns the current row value for key.voidinitValues(Map aMap) Initialize row values from map (or Entity default values).booleanReturns whether this row's row object has been changed.voidpropertyChange(PropertyChangeEvent anEvent) PropertyChangeListener method to propagate changes from row object to row.Override put to do conversion.Put value by string.@Nullable RowRemoves an object from list at given index.Removes an object from a list at given index.voidRemove a property change listener.voidsave()Saves this row.voidSets the entity that describes the data in this row.protected voidsetExists(boolean aFlag) Sets whether file exists in data source (has been saved and, if so, not deleted).voidsetJSONValue(String aKey, Object aValue) RMJSONArchiver method to put archiver values and handle NewValues.protected voidsetModified(boolean aValue) Sets whether this row's row object has been changed.voidsetModifiedTime(long aTime) Sets the file modification time.protected voidSets the WebSite that created this row.toString()Standard toString implementation.Methods inherited from class HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, newHashMap, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class AbstractMap
hashCode
-
Constructor Details
-
Row
public Row()
-
-
Method Details
-
getSite
Returns the WebSite that created this row. -
setSite
Sets the WebSite that created this row. -
getEntity
Returns the entity that describes the data in this row. -
setEntity
Sets the entity that describes the data in this row. -
getProperty
-
getPrimaryValue
Returns the primary property. -
initValues
Initialize row values from map (or Entity default values). -
get
-
get
-
get
-
getValue
-
getValue
-
getRaw
-
put
-
put
-
getOriginal
Returns the original state of this row (or null if row not modified). -
createOriginal
Returns the row this row was loaded from or the original state of this row. -
getUnresolvedRelationRows
Returns an array of relation rows for this row that don't have a primary key value. -
add
-
add
-
remove
-
remove
-
getExists
public boolean getExists()Returns whether file exists in data source (has been saved and, if so, not deleted). -
setExists
protected void setExists(boolean aFlag) Sets whether file exists in data source (has been saved and, if so, not deleted). -
getModifiedTime
public long getModifiedTime()Returns the file modification time. -
setModifiedTime
public void setModifiedTime(long aTime) Sets the file modification time. -
isModified
public boolean isModified()Returns whether this row's row object has been changed. -
setModified
protected void setModified(boolean aValue) Sets whether this row's row object has been changed. -
save
public void save()Saves this row. -
delete
public void delete()Deletes this row. -
propertyChange
PropertyChangeListener method to propagate changes from row object to row.- Specified by:
propertyChangein interfacePropertyChangeListener
-
addPropertyChangeListener
Add a property change listener. -
removePropertyChangeListener
Remove a property change listener. -
firePropertyChange
-
getJSONKeys
RMJSONArchiver method to return keys in property order and, potentially, NewValues key.- Specified by:
getJSONKeysin interfaceRMJSONArchiver.GetKeys
-
getJSONValue
RMJSONArchiver method to get archiver values via getValue() and handle NewValues.- Specified by:
getJSONValuein interfaceRMJSONArchiver.GetValue
-
setJSONValue
RMJSONArchiver method to put archiver values and handle NewValues.- Specified by:
setJSONValuein interfaceRMJSONArchiver.SetValue
-
equals
-
toString
Standard toString implementation.- Overrides:
toStringin classAbstractMap<String,Object>
-