Package net.solarnetwork.central.dao
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 -
Method Summary
Modifier and TypeMethodDescriptionclone()voidbooleandiffersFrom(C other) Get the modification date.Get the user ID this entity relates to.ident()Get a short identifier string.booleanGet the enabled flag.booleanTest if this entity has the same property values as another.voidsetEnabled(boolean enabled) Set the enabled flag.voidsetModified(Instant modified) Set the modification date.Methods inherited from class net.solarnetwork.dao.BasicEntity
getCreatedMethods inherited from class net.solarnetwork.dao.BasicIdentity
compareTo, equals, getId, hashCodeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface net.solarnetwork.domain.CopyingIdentity
copyWithIdMethods inherited from interface net.solarnetwork.dao.Entity
getCreatedMethods inherited from interface net.solarnetwork.domain.Identity
getId, hasId
-
Constructor Details
-
BaseUserModifiableEntity
Constructor.- Parameters:
id- the IDcreated- the creation date- Throws:
IllegalArgumentException- if any argument is null
-
-
Method Details
-
clone
- Overrides:
clonein classnet.solarnetwork.dao.BasicEntity<K extends CompositeKey & Comparable<K> & Serializable>
-
copyTo
- Specified by:
copyToin interfacenet.solarnetwork.domain.CopyingIdentity<C extends BaseUserModifiableEntity<C,K>, K extends CompositeKey & Comparable<K> & Serializable>
-
isSameAs
Test if this entity has the same property values as another.The
id,created, andmodifiedproperties 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
- Specified by:
differsFromin interfacenet.solarnetwork.domain.Differentiable<C extends BaseUserModifiableEntity<C,K>>
-
getUserId
Description copied from interface:UserRelatedEntityGet the user ID this entity relates to.- Specified by:
getUserIdin interfaceUserIdRelated- Specified by:
getUserIdin interfaceUserRelatedEntity<C extends BaseUserModifiableEntity<C,K>> - Returns:
- the user ID
-
ident
Get a short identifier string.- Returns:
- the identifier, which includes the
modifiedepoch seconds, if available - Since:
- 1.1
-
getModified
Get the modification date.- Returns:
- the modified date
-
setModified
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
-