Record Class GlowingEntities.EntityIdentifierEID
java.lang.Object
java.lang.Record
fr.skytasul.glowingentities.GlowingEntities.EntityIdentifierEID
- All Implemented Interfaces:
GlowingEntities.EntityIdentifier
- Enclosing class:
GlowingEntities
public static record GlowingEntities.EntityIdentifierEID(int entityId, @NotNull org.bukkit.World world)
extends Record
implements GlowingEntities.EntityIdentifier
- Author:
- SkytAsul
-
Constructor Summary
ConstructorsConstructorDescriptionEntityIdentifierEID(int entityId, @NotNull org.bukkit.World world) Creates an instance of aEntityIdentifierEIDrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintentityId()Returns the value of theentityIdrecord 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.@NotNull org.bukkit.Worldworld()Returns the value of theworldrecord component.
-
Constructor Details
-
EntityIdentifierEID
public EntityIdentifierEID(int entityId, @NotNull @NotNull org.bukkit.World world) Creates an instance of aEntityIdentifierEIDrecord class.- Parameters:
entityId- the value for theentityIdrecord componentworld- the value for theworldrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
entityId
public int entityId()Returns the value of theentityIdrecord component.- Returns:
- the value of the
entityIdrecord component
-
world
@NotNull public @NotNull org.bukkit.World world()Returns the value of theworldrecord component.- Returns:
- the value of the
worldrecord component
-