Class BaseUserModifiableEntity<C extends BaseUserModifiableEntity<C,K>,K extends CompositeKey & Comparable<K> & Serializable>

java.lang.Object
net.solarnetwork.dao.BasicIdentity<K>
net.solarnetwork.dao.BasicEntity<K>
net.solarnetwork.central.dao.BaseUserModifiableEntity<C,K>
All Implemented Interfaces:
Serializable, Cloneable, Comparable<K>, UserRelatedEntity<K>, UserIdRelated, net.solarnetwork.dao.Entity<K>, net.solarnetwork.domain.CopyingIdentity<K,C>, net.solarnetwork.domain.Differentiable<C>, net.solarnetwork.domain.Identity<K>
Direct Known Subclasses:
BaseUserCertificate

public abstract class BaseUserModifiableEntity<C extends BaseUserModifiableEntity<C,K>,K extends CompositeKey & Comparable<K> & Serializable> extends net.solarnetwork.dao.BasicEntity<K> implements UserRelatedEntity<K>, net.solarnetwork.domain.CopyingIdentity<K,C>, net.solarnetwork.domain.Differentiable<C>, Serializable, Cloneable
Base mutable user-related configuration entity, where the first component of its primary key is a Long user ID.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
    copyTo(C entity)
     
    boolean
    differsFrom(C other)
     
    Get the modification date.
    Get the user ID this entity relates to.
    Get a short identifier string.
    boolean
    Get the enabled flag.
    boolean
    isSameAs(C other)
    Test if this entity has the same property values as another.
    void
    setEnabled(boolean enabled)
    Set the enabled flag.
    void
    setModified(Instant modified)
    Set the modification date.

    Methods inherited from class net.solarnetwork.dao.BasicEntity

    getCreated

    Methods inherited from class net.solarnetwork.dao.BasicIdentity

    compareTo, equals, getId, hashCode

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Comparable

    compareTo

    Methods inherited from interface net.solarnetwork.domain.CopyingIdentity

    copyWithId

    Methods inherited from interface net.solarnetwork.dao.Entity

    getCreated

    Methods inherited from interface net.solarnetwork.domain.Identity

    getId, hasId
  • Constructor Details

    • BaseUserModifiableEntity

      public BaseUserModifiableEntity(K id, Instant created)
      Constructor.
      Parameters:
      id - the ID
      created - the creation date
      Throws:
      IllegalArgumentException - if any argument is null
  • Method Details

    • clone

      public C clone()
      Overrides:
      clone in class net.solarnetwork.dao.BasicEntity<K extends CompositeKey & Comparable<K> & Serializable>
    • copyTo

      public void copyTo(C entity)
      Specified by:
      copyTo in interface net.solarnetwork.domain.CopyingIdentity<C extends BaseUserModifiableEntity<C,K>,K extends CompositeKey & Comparable<K> & Serializable>
    • isSameAs

      public boolean isSameAs(C other)
      Test if this entity has the same property values as another.

      The id, created, and modified properties are not compared.

      Parameters:
      other - the entity to compare to
      Returns:
      true if the properties of this entity are equal to the other's
    • differsFrom

      public boolean differsFrom(C other)
      Specified by:
      differsFrom in interface net.solarnetwork.domain.Differentiable<C extends BaseUserModifiableEntity<C,K>>
    • 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<C extends BaseUserModifiableEntity<C,K>>
      Returns:
      the user ID
    • ident

      public String ident()
      Get a short identifier string.
      Returns:
      the identifier, which includes the modified epoch seconds, if available
      Since:
      1.1
    • getModified

      public Instant getModified()
      Get the modification date.
      Returns:
      the modified date
    • setModified

      public void setModified(Instant modified)
      Set the modification date.
      Parameters:
      modified - the modified date to set
    • isEnabled

      public boolean isEnabled()
      Get the enabled flag.
      Returns:
      true if enabled
    • setEnabled

      public void setEnabled(boolean enabled)
      Set the enabled flag.
      Parameters:
      enabled - the value to set