Class ActivationChange

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ActivationChange>

    public final class ActivationChange
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Comparable<ActivationChange>
    Class handling a single activation change event.
    Author:
    Christopher Mindus
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and TypeFieldDescription
      protected LicensingHistoryEventevent
      The history event that caused the change.
      protected inthashCode
      The hash code cache, zero for none.
      protected java.lang.Stringmsg
      The message.
      protected longtime
      The creation time in milliseconds since epoch.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      intcompareTo​(ActivationChange o)
      Compares two entries.
      booleanequals​(java.lang.Object o)
      Checks for equality.
      LicensingHistoryEventgetEvent()
      Gets the history event.
      java.lang.StringgetMessage()
      Gets the message.
      longgetTime()
      Gets the time in milliseconds since the epoch when the change occurred.
      java.lang.StringgetUnparsedString()
      Produces an internal string representation of this change in a String that can be parsed by the constructor ActivationChange(String).
      inthashCode()
      Gets the hash code.
      java.lang.StringtoString()
      Produces a textual entry for the event.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • time

        protected long time
        The creation time in milliseconds since epoch.
      • msg

        protected java.lang.String msg
        The message.
      • hashCode

        protected int hashCode
        The hash code cache, zero for none.
    • Constructor Detail

      • ActivationChange

        public ActivationChange​(java.lang.String string)
        Constructor from a String.
        Parameters:
        string - The string of changes.
        Throws:
        java.lang.NullPointerException - If string is null.
        java.lang.NumberFormatException - If numbers cannot be parsed.
        java.lang.IllegalArgumentException - If the string event is wrong.
      • ActivationChange

        public ActivationChange​(LicensingHistoryEvent event,
                                java.lang.String msg)
        Constructor from a history event and a message.
        Parameters:
        event - The history event.
        msg - The message.
        Throws:
        java.lang.NullPointerException - If event or msg is null.
    • Method Detail

      • getTime

        public long getTime()
        Gets the time in milliseconds since the epoch when the change occurred.
        Returns:
        Time in milliseconds since the epoch
      • getMessage

        public java.lang.String getMessage()
        Gets the message.
        Returns:
        The message string, never null.
      • getUnparsedString

        public java.lang.String getUnparsedString()
        Produces an internal string representation of this change in a String that can be parsed by the constructor ActivationChange(String).
        Returns:
        A string formatted as "epochTimeInMillis,eventValue,message".
      • toString

        public java.lang.String toString()
        Produces a textual entry for the event.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string formatted as "31 jan 2014 23:59:59.123 [Event] Message".
      • equals

        public boolean equals​(java.lang.Object o)
        Checks for equality.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Gets the hash code.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        A hash code of this entry.
      • compareTo

        public int compareTo​(ActivationChange o)
        Compares two entries.
        Specified by:
        compareTo in interface java.lang.Comparable<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.