Package com.iizix.license.history
Class LicensingHistory
java.lang.Object
com.iizix.license.history.LicensingHistory
- All Implemented Interfaces:
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 Summary
FieldsConstructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionvoidaddEntries(LicensingHistoryEntry[] entries, int startIndex) Removes all history entries before the specified index.voidaddEntry(LicensingHistoryEntry entry) Adds a new history entry.voidaddEntry(LicensingHistoryEvent event, String text) Adds a new history entry.Gets all the entries.voidlist(StringBuilder sb, String indent) Lists the history with an indent string to a StringBuilder.intremoveAllEntriesAtAndAfter(int index) Removes all history entries before the specified index.toString()Produces a String representation.
Field Details
history
List of entries.
Constructor Details
LicensingHistory
public LicensingHistory()Public constructor to create an empty history.
Method Details
addEntry
Adds a new history entry.- Parameters:
event- The event.text- The text.- Throws:
NullPointerException- Ifeventortextis null.
addEntry
Adds a new history entry.- Parameters:
entry- The entry to add.- Throws:
NullPointerException- Ifeventortextis 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 theindexparameter.- Parameters:
index- The index.- Returns:
- Number of entries removed.
addEntries
Removes all history entries before the specified index. In other words, this call will keep all history entries with index values less than theindexparameter.- Parameters:
entries- The entries to add.startIndex- The starting index.
getEntries
Gets all the entries.list
Lists the history with an indent string to a StringBuilder.- Parameters:
sb- The StringBuilder.indent- The indent string.
toString
Produces a String representation.