Package com.iizix.license.history
Class ActivationChange
java.lang.Object
com.iizix.license.history.ActivationChange
- All Implemented Interfaces:
Serializable
,Comparable<ActivationChange>
public final class ActivationChange extends Object implements Serializable, Comparable<ActivationChange>
Class handling a single activation change event.
- Author:
- Christopher Mindus
- See Also:
Field Summary
Constructor Summary
ConstructorDescriptionActivationChange
(LicensingHistoryEvent event, String msg) Constructor from a history event and a message.ActivationChange
(String string) Constructor from a String.Method Summary
Modifier and TypeMethodDescriptionint
Compares two entries.boolean
Checks for equality.getEvent()
Gets the history event.Gets the message.long
getTime()
Gets the time in milliseconds since the epoch when the change occurred.Produces an internal string representation of this change in a String that can be parsed by the constructorActivationChange(String)
.int
hashCode()
Gets the hash code.toString()
Produces a textual entry for the event.
Field Details
time
protected long timeThe creation time in milliseconds since epoch.event
The history event that caused the change.msg
The message.hashCode
protected int hashCodeThe hash code cache, zero for none.
Constructor Details
ActivationChange
Constructor from a String.- Parameters:
string
- The string of changes.- Throws:
NullPointerException
- If string is null.NumberFormatException
- If numbers cannot be parsed.IllegalArgumentException
- If the string event is wrong.
ActivationChange
Constructor from a history event and a message.- Parameters:
event
- The history event.msg
- The message.- Throws:
NullPointerException
- If event or msg is null.
Method Details
getTime
public long getTime()Gets the time in milliseconds since the epoch when the change occurred.- Returns:
- Time in milliseconds since the epoch
getEvent
Gets the history event.- Returns:
- The history event.
getMessage
Gets the message.- Returns:
- The message string, never null.
getUnparsedString
Produces an internal string representation of this change in a String that can be parsed by the constructorActivationChange(String)
.- Returns:
- A string formatted as "epochTimeInMillis,eventValue,message".
toString
Produces a textual entry for the event.equals
Checks for equality.hashCode
public int hashCode()Gets the hash code.compareTo
Compares two entries.- Specified by:
compareTo
in interfaceComparable<ActivationChange>
- Parameters:
o
- The other entry.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.