Package com.iizix.license.history
Class LicensingHistory
- java.lang.Object
- com.iizix.license.history.LicensingHistory
 
- All Implemented Interfaces:
- java.io.Serializable
 - public final class LicensingHistory extends java.lang.Object implements java.io.SerializableClass 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:
- Serialized Form
 
- Field Summary- Fields - Modifier and Type - Field - Description - protected java.util.ArrayList<LicensingHistoryEntry>- historyList of entries.
 - Constructor Summary- Constructors - Constructor - Description - LicensingHistory()Public constructor to create an empty history.
 - Method Summary- All Methods Instance Methods Concrete Methods - Modifier and Type - Method - Description - void- addEntries(LicensingHistoryEntry[] entries, int startIndex)Removes all history entries before the specified index.- void- addEntry(LicensingHistoryEntry entry)Adds a new history entry.- void- addEntry(LicensingHistoryEvent event, java.lang.String text)Adds a new history entry.- LicensingHistoryEntry[]- getEntries()Gets all the entries.- void- list(java.lang.StringBuilder sb, java.lang.String indent)Lists the history with an indent string to a StringBuilder.- int- removeAllEntriesAtAndAfter(int index)Removes all history entries before the specified index.- java.lang.String- toString()Produces a String representation.
 
- Field Detail- history- protected final java.util.ArrayList<LicensingHistoryEntry> history List of entries.
 
 - Method Detail- addEntry- public void addEntry(LicensingHistoryEvent event, java.lang.String text) Adds a new history entry.- Parameters:
- event- The event.
- text- The text.
- Throws:
- java.lang.NullPointerException- If- eventor- textis null.
 
 - addEntry- public void addEntry(LicensingHistoryEntry entry) Adds a new history entry.- Parameters:
- entry- The entry to add.
- Throws:
- java.lang.NullPointerException- If- eventor- textis 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- indexparameter.- 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- indexparameter.- Parameters:
- entries- The entries to add.
- startIndex- The starting index.
 
 - getEntries- public LicensingHistoryEntry[] getEntries() Gets all the entries.
 - list- public void list(java.lang.StringBuilder sb, java.lang.String indent)Lists the history with an indent string to a StringBuilder.- Parameters:
- sb- The StringBuilder.
- indent- The indent string.
 
 - toString- public java.lang.String toString() Produces a String representation.- Overrides:
- toStringin class- java.lang.Object
- Returns:
- A String of history entries.