Module fr.ght1pc9kc.entity.api
Package fr.ght1pc9kc.entity.api.impl
Record Class ExtendedEntity<T,E extends Enum<E>>
java.lang.Object
java.lang.Record
fr.ght1pc9kc.entity.api.impl.ExtendedEntity<T,E>
- All Implemented Interfaces:
Entity<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<S> Entity<S>
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.@NotNull String
id()
Returns the value of theid
record component.<M> Optional<M>
metas()
Returns the value of themetas
record component.self()
Returns the value of theself
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ExtendedEntity
public ExtendedEntity(@NotNull @NotNull String id, @NotNull @NotNull EnumMap<E, Object> metas, @NotNull T self) Creates an instance of aExtendedEntity
record class.- Parameters:
id
- the value for theid
record componentmetas
- the value for themetas
record componentself
- the value for theself
record component
-
-
Method Details
-
meta
-
convert
-
withMeta
-
metas
Returns the value of themetas
record component.- Returns:
- the value of the
metas
record component
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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)
. -
id
Returns the value of theid
record component. -
self
Returns the value of theself
record component.
-