Record Class GlowingEntities.EntityidentifierRealEntity
java.lang.Object
java.lang.Record
fr.skytasul.glowingentities.GlowingEntities.EntityidentifierRealEntity
- All Implemented Interfaces:
GlowingEntities.EntityIdentifier
- Enclosing class:
GlowingEntities
public static record GlowingEntities.EntityidentifierRealEntity(@NotNull org.bukkit.entity.Entity entity)
extends Record
implements GlowingEntities.EntityIdentifier
- Author:
- SkytAsul
-
Constructor Summary
ConstructorsConstructorDescriptionEntityidentifierRealEntity(@NotNull org.bukkit.entity.Entity entity) Creates an instance of aEntityidentifierRealEntityrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull org.bukkit.entity.Entityentity()Returns the value of theentityrecord component.final booleanIndicates whether some other object is "equal to" this one.@NotNull OptionalIntgetEntityId(@NotNull org.bukkit.World world) Returns the entity ID (EID) of the entity represented by this object.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EntityidentifierRealEntity
public EntityidentifierRealEntity(@NotNull @NotNull org.bukkit.entity.Entity entity) Creates an instance of aEntityidentifierRealEntityrecord class.- Parameters:
entity- the value for theentityrecord component
-
-
Method Details
-
getEntityId
Description copied from interface:GlowingEntities.EntityIdentifierReturns the entity ID (EID) of the entity represented by this object. If the entity is not currently inworldthen an empty Optional should be returned.- Specified by:
getEntityIdin interfaceGlowingEntities.EntityIdentifier- Parameters:
world- world in which the entity should be- Returns:
- the EID of the entity or an empty optional if the entity is not in the world
-
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). -
entity
@NotNull public @NotNull org.bukkit.entity.Entity entity()Returns the value of theentityrecord component.- Returns:
- the value of the
entityrecord component
-