Class UserEvent

java.lang.Object
net.solarnetwork.dao.BasicIdentity<UserUuidPK>
net.solarnetwork.central.domain.UserEvent
All Implemented Interfaces:
Serializable, Cloneable, Comparable<UserUuidPK>, UserRelatedEntity<UserUuidPK>, UserIdRelated, net.solarnetwork.dao.Entity<UserUuidPK>, net.solarnetwork.domain.Identity<UserUuidPK>

public class UserEvent extends net.solarnetwork.dao.BasicIdentity<UserUuidPK> implements net.solarnetwork.dao.Entity<UserUuidPK>, UserRelatedEntity<UserUuidPK>, Serializable, Cloneable
An application event related to a user.

Note that time-based UUIDs are assumed for getCreated() to work, and microsecond precision time is assumed for V7 UUIDs. See

invalid reference
UuidUtils#extractTimestamp(UUID, boolean)
.

See Also:
  • Constructor Details

    • UserEvent

      public UserEvent(UserUuidPK id, String[] tags, String message, String data)
      Constructor.
      Parameters:
      id - the primary key
      tags - the tags
      message - the message
      data - the JSON data
      Throws:
      IllegalArgumentException - if id or tags are null
    • UserEvent

      public UserEvent(Long userId, UUID eventId, String[] tags, String message, String data)
      Constructor.
      Parameters:
      userId - the user ID
      eventId - the event ID
      message - the message
      data - the JSON data
      created - the creation date
      kind - the event kind
      Throws:
      IllegalArgumentException - if any argument is null other than message or data
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clone

      public UserEvent clone()
      Overrides:
      clone in class net.solarnetwork.dao.BasicIdentity<UserUuidPK>
    • getUserId

      public Long getUserId()
      Description copied from interface: UserRelatedEntity
      Get the user ID this entity relates to.
      Specified by:
      getUserId in interface UserIdRelated
      Specified by:
      getUserId in interface UserRelatedEntity<UserUuidPK>
      Returns:
      the user ID
    • getCreated

      public Instant getCreated()
      Specified by:
      getCreated in interface net.solarnetwork.dao.Entity<UserUuidPK>
    • getEventId

      public UUID getEventId()
      Get the event ID.
      Returns:
      the event ID
    • getTags

      public String[] getTags()
      Get the event tags.
      Returns:
      the tags
    • getMessage

      public String getMessage()
      Get the message.
      Returns:
      the message
    • getData

      public String getData()
      Get the JSON data.
      Returns:
      the data