Class LicensingHistory

java.lang.Object
com.iizix.license.history.LicensingHistory
All Implemented Interfaces:
Serializable

public final class LicensingHistory extends Object implements Serializable
Class used to hold information about licensing history, i.e. what has been done and when in regards to the license.
Author:
Christopher Mindus
See Also:
  • Field Details

  • Constructor Details

    • LicensingHistory

      public LicensingHistory()
      Public constructor to create an empty history.
  • Method Details

    • addEntry

      public void addEntry(LicensingHistoryEvent event, String text)
      Adds a new history entry.
      Parameters:
      event - The event.
      text - The text.
      Throws:
      NullPointerException - If event or text is null.
    • addEntry

      public void addEntry(LicensingHistoryEntry entry)
      Adds a new history entry.
      Parameters:
      entry - The entry to add.
      Throws:
      NullPointerException - If event or text is null.
    • removeAllEntriesAtAndAfter

      public int removeAllEntriesAtAndAfter(int index)
      Removes all history entries before the specified index. In other words, this call will keep all history entries with index values less than the index parameter.
      Parameters:
      index - The index.
      Returns:
      Number of entries removed.
    • addEntries

      public void addEntries(LicensingHistoryEntry[] entries, int startIndex)
      Removes all history entries before the specified index. In other words, this call will keep all history entries with index values less than the index parameter.
      Parameters:
      entries - The entries to add.
      startIndex - The starting index.
    • getEntries

      public LicensingHistoryEntry[] getEntries()
      Gets all the entries.
    • list

      public void list(StringBuilder sb, String indent)
      Lists the history with an indent string to a StringBuilder.
      Parameters:
      sb - The StringBuilder.
      indent - The indent string.
    • toString

      public String toString()
      Produces a String representation.
      Overrides:
      toString in class Object
      Returns:
      A String of history entries.