Package com.inductiveautomation.snap.web
Class Row
- java.lang.Object
- 
- java.util.AbstractMap<K,V>
- 
- java.util.HashMap<java.lang.String,java.lang.Object>
- 
- com.inductiveautomation.snap.web.Row
 
 
 
- 
- All Implemented Interfaces:
- RMJSONArchiver.GetKeys,- RMJSONArchiver.GetValue,- RMJSONArchiver.SetValue,- java.beans.PropertyChangeListener,- java.io.Serializable,- java.lang.Cloneable,- java.util.EventListener,- java.util.Map<java.lang.String,java.lang.Object>
 - Direct Known Subclasses:
- SnapRow
 
 public class Row extends java.util.HashMap<java.lang.String,java.lang.Object> implements java.beans.PropertyChangeListener, RMJSONArchiver.GetKeys, RMJSONArchiver.GetValue, RMJSONArchiver.SetValue Represents a data bearing object from a WebSite.- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description Row()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Property aProperty, Row aRow, int anIndex)Adds an object to a list at given index.voidadd(java.lang.String aKey, Row aRow, int anIndex)Adds an object to a list at given index.voidaddPropertyChangeListener(java.beans.PropertyChangeListener aListener)Add a property change listener.protected RowcreateOriginal()Returns the row this row was loaded from or the original state of this row.voiddelete()Deletes this row.booleanequals(java.lang.Object anObj)Override to just check identity, since rows are unique.protected voidfirePropertyChange(java.lang.String aPropName, java.lang.Object anOldVal, java.lang.Object aNewVal, int anIndex)Fires a property change.java.lang.Objectget(Property aProperty)Returns the current row value for key.java.lang.Objectget(java.lang.Object aKey)Returns the current row value for key.java.lang.Objectget(java.lang.String aKey)Returns the current row value for key.EntitygetEntity()Returns the entity that describes the data in this row.booleangetExists()Returns whether file exists in data source (has been saved and, if so, not deleted).java.util.List<java.lang.String>getJSONKeys()RMJSONArchiver method to return keys in property order and, potentially, NewValues key.java.lang.ObjectgetJSONValue(java.lang.String aKey)RMJSONArchiver method to get archiver values via getValue() and handle NewValues.longgetModifiedTime()Returns the file modification time.RowgetOriginal()Returns the original state of this row (or null if row not modified).java.lang.ObjectgetPrimaryValue()Returns the primary property.PropertygetProperty(java.lang.String aName)Returns the named property.protected java.lang.ObjectgetRaw(Property aProperty)Returns the current value or RowLink for a key.WebSitegetSite()Returns the WebSite that created this row.Row[]getUnresolvedRelationRows()Returns an array of relation rows for this row that don't have a primary key value.java.lang.ObjectgetValue(Property aProperty)Returns the current row value for key.java.lang.ObjectgetValue(java.lang.String aKey)Returns the current row value for key.voidinitValues(java.util.Map aMap)Initialize row values from map (or Entity default values).booleanisModified()Returns whether this row's row object has been changed.voidpropertyChange(java.beans.PropertyChangeEvent anEvent)PropertyChangeListener method to propagate changes from row object to row.java.lang.Objectput(Property aProperty, java.lang.Object anObj)Override put to do conversion.java.lang.Objectput(java.lang.String aKey, java.lang.Object aValue)Put value by string.Rowremove(Property aProperty, int anIndex)Removes an object from list at given index.Rowremove(java.lang.String aKey, int anIndex)Removes an object from a list at given index.voidremovePropertyChangeListener(java.beans.PropertyChangeListener aListener)Remove a property change listener.voidsave()Saves this row.voidsetEntity(Entity anEntity)Sets 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(java.lang.String aKey, java.lang.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 voidsetSite(WebSite aSite)Sets the WebSite that created this row.java.lang.StringtoString()Standard toString implementation.- 
Methods inherited from class java.util.HashMapclear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
 
- 
 
- 
- 
- 
Method Detail- 
getSitepublic WebSite getSite() Returns the WebSite that created this row.
 - 
setSiteprotected void setSite(WebSite aSite) Sets the WebSite that created this row.
 - 
getEntitypublic Entity getEntity() Returns the entity that describes the data in this row.
 - 
setEntitypublic void setEntity(Entity anEntity) Sets the entity that describes the data in this row.
 - 
getPropertypublic Property getProperty(java.lang.String aName) Returns the named property.
 - 
getPrimaryValuepublic java.lang.Object getPrimaryValue() Returns the primary property.
 - 
initValuespublic void initValues(java.util.Map aMap) Initialize row values from map (or Entity default values).
 - 
get@Nullable public java.lang.Object get(java.lang.Object aKey) Returns the current row value for key. If key is a relation, return value as an Row or List <Row>>.- Specified by:
- getin interface- java.util.Map<java.lang.String,java.lang.Object>
- Overrides:
- getin class- java.util.HashMap<java.lang.String,java.lang.Object>
 
 - 
get@Nullable public java.lang.Object get(java.lang.String aKey) Returns the current row value for key. If key is a relation, return value as a Row or List <Row>>.
 - 
get@Nullable public java.lang.Object get(Property aProperty) Returns the current row value for key. If key is a relation, return value as a Row or List <Row>>.
 - 
getValuepublic java.lang.Object getValue(java.lang.String aKey) Returns the current row value for key.
 - 
getValuepublic java.lang.Object getValue(Property aProperty) Returns the current row value for key.
 - 
getRawprotected java.lang.Object getRaw(Property aProperty) Returns the current value or RowLink for a key.
 - 
putpublic java.lang.Object put(java.lang.String aKey, java.lang.Object aValue)Put value by string.- Specified by:
- putin interface- java.util.Map<java.lang.String,java.lang.Object>
- Overrides:
- putin class- java.util.HashMap<java.lang.String,java.lang.Object>
 
 - 
putpublic java.lang.Object put(Property aProperty, java.lang.Object anObj) Override put to do conversion.
 - 
getOriginalpublic Row getOriginal() Returns the original state of this row (or null if row not modified).
 - 
createOriginalprotected Row createOriginal() Returns the row this row was loaded from or the original state of this row.
 - 
getUnresolvedRelationRowspublic Row[] getUnresolvedRelationRows() Returns an array of relation rows for this row that don't have a primary key value.
 - 
addpublic void add(java.lang.String aKey, Row aRow, int anIndex)Adds an object to a list at given index.
 - 
addpublic void add(Property aProperty, Row aRow, int anIndex) Adds an object to a list at given index.
 - 
removepublic Row remove(java.lang.String aKey, int anIndex) Removes an object from a list at given index.
 - 
remove@Nullable public Row remove(Property aProperty, int anIndex) Removes an object from list at given index.
 - 
getExistspublic boolean getExists() Returns whether file exists in data source (has been saved and, if so, not deleted).
 - 
setExistsprotected void setExists(boolean aFlag) Sets whether file exists in data source (has been saved and, if so, not deleted).
 - 
getModifiedTimepublic long getModifiedTime() Returns the file modification time.
 - 
setModifiedTimepublic void setModifiedTime(long aTime) Sets the file modification time.
 - 
isModifiedpublic boolean isModified() Returns whether this row's row object has been changed.
 - 
setModifiedprotected void setModified(boolean aValue) Sets whether this row's row object has been changed.
 - 
savepublic void save() Saves this row.
 - 
deletepublic void delete() Deletes this row.
 - 
propertyChangepublic void propertyChange(java.beans.PropertyChangeEvent anEvent) PropertyChangeListener method to propagate changes from row object to row.- Specified by:
- propertyChangein interface- java.beans.PropertyChangeListener
 
 - 
addPropertyChangeListenerpublic void addPropertyChangeListener(java.beans.PropertyChangeListener aListener) Add a property change listener.
 - 
removePropertyChangeListenerpublic void removePropertyChangeListener(java.beans.PropertyChangeListener aListener) Remove a property change listener.
 - 
firePropertyChangeprotected void firePropertyChange(java.lang.String aPropName, java.lang.Object anOldVal, java.lang.Object aNewVal, int anIndex)Fires a property change.
 - 
getJSONKeyspublic java.util.List<java.lang.String> getJSONKeys() RMJSONArchiver method to return keys in property order and, potentially, NewValues key.- Specified by:
- getJSONKeysin interface- RMJSONArchiver.GetKeys
 
 - 
getJSONValuepublic java.lang.Object getJSONValue(java.lang.String aKey) RMJSONArchiver method to get archiver values via getValue() and handle NewValues.- Specified by:
- getJSONValuein interface- RMJSONArchiver.GetValue
 
 - 
setJSONValuepublic void setJSONValue(java.lang.String aKey, java.lang.Object aValue)RMJSONArchiver method to put archiver values and handle NewValues.- Specified by:
- setJSONValuein interface- RMJSONArchiver.SetValue
 
 - 
equalspublic boolean equals(java.lang.Object anObj) Override to just check identity, since rows are unique.- Specified by:
- equalsin interface- java.util.Map<java.lang.String,java.lang.Object>
- Overrides:
- equalsin class- java.util.AbstractMap<java.lang.String,java.lang.Object>
 
 - 
toStringpublic java.lang.String toString() Standard toString implementation.- Overrides:
- toStringin class- java.util.AbstractMap<java.lang.String,java.lang.Object>
 
 
- 
 
-