Record Class DomainEntity<T>
java.lang.Object
java.lang.Record
net.tangly.core.domain.DomainEntity<T>
- Type Parameters:
T- type of the domain entity.
public record DomainEntity<T>(@NotNull String domain, @NotNull Class<T> clazz, Provider<T> provider)
extends Record
Define the meta-information describing the characteristics of a domain entity. Helper methods are provided to collect statistical information on the
instances of the domain entity.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclazz()Returns the value of theclazzrecord component.long@NotNull Stringdomain()Returns the value of thedomainrecord component.longfinal booleanIndicates whether some other object is "equal to" this one.booleanfinal inthashCode()Returns a hash code value for this object.booleanhasId()booleanhasOid()booleanhasTags()name()provider()Returns the value of theproviderrecord component.longfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DomainEntity
public DomainEntity(@NotNull @NotNull String domain, @NotNull @NotNull Class<T> clazz, Provider<T> provider) Creates an instance of aDomainEntityrecord class.- Parameters:
domain- the value for thedomainrecord componentclazz- the value for theclazzrecord componentprovider- the value for theproviderrecord component
-
-
Method Details
-
hasOid
public boolean hasOid() -
hasId
public boolean hasId() -
hasComments
public boolean hasComments() -
hasTags
public boolean hasTags() -
name
-
entitiesCount
public long entitiesCount() -
tagsCount
public long tagsCount() -
commentsCount
public long commentsCount() -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
domain
Returns the value of thedomainrecord component.- Returns:
- the value of the
domainrecord component
-
clazz
-
provider
-