Class MetisFieldVersionHistory

java.lang.Object
io.github.tonywasher.joceanus.metis.field.MetisFieldVersionHistory
All Implemented Interfaces:
MetisDataItem.MetisDataObjectFormat, MetisFieldItem

public class MetisFieldVersionHistory extends Object implements MetisFieldItem
Data Version History.
  • Constructor Details

    • MetisFieldVersionHistory

      protected MetisFieldVersionHistory(MetisFieldVersionValues pCurr)
      Constructor.
      Parameters:
      pCurr - the current values
  • Method Details

    • getDataFieldSet

      public MetisFieldItem.MetisFieldSetDef getDataFieldSet()
      Description copied from interface: MetisFieldItem
      Obtain the fieldSet.
      Specified by:
      getDataFieldSet in interface MetisFieldItem
      Returns:
      the fieldSet
    • formatObject

      public String formatObject(OceanusDataFormatter pFormatter)
      Description copied from interface: MetisDataItem.MetisDataObjectFormat
      Obtain Object summary.
      Specified by:
      formatObject in interface MetisDataItem.MetisDataObjectFormat
      Parameters:
      pFormatter - the data formatter
      Returns:
      the display summary of the object
    • setValues

      protected void setValues(MetisFieldVersionValues pValues)
      Initialise the current values.
      Parameters:
      pValues - the current values
    • getValueSet

      protected MetisFieldVersionValues getValueSet()
      Get the changeable values object for this item.
      Returns:
      the object
    • getOriginalValues

      protected MetisFieldVersionValues getOriginalValues()
      Get original values.
      Returns:
      original values
    • pushHistory

      public void pushHistory(int pVersion)
      Push Item to the history.
      Parameters:
      pVersion - the new version
    • popTheHistory

      public void popTheHistory()
      popItem from the history and remove from history.
    • maybePopHistory

      public boolean maybePopHistory()
      popItem from the history if equal to current.
      Returns:
      was a change made
    • hasHistory

      public boolean hasHistory()
      Is there any history?
      Returns:
      whether there are entries in the history list
    • getLastValues

      public MetisFieldVersionValues getLastValues()
      Obtain the last values.
      Returns:
      the last values (or null)
    • clearHistory

      protected void clearHistory()
      Clear history.
    • resetHistory

      protected void resetHistory()
      Reset history.
    • setHistory

      public void setHistory(MetisFieldVersionValues pBase)
      Set history explicitly.
      Parameters:
      pBase - the base item
    • condenseHistory

      protected void condenseHistory(int pNewVersion)
      Condense history.
      Parameters:
      pNewVersion - the new maximum version
    • fieldChanged

      public MetisDataDifference fieldChanged(MetisFieldItem.MetisFieldDef pField)
      Determines whether a particular field has changed.
      Parameters:
      pField - the field
      Returns:
      the difference