Record Class VillagerTypeImpl
java.lang.Object
java.lang.Record
net.minestom.server.entity.villager.VillagerTypeImpl
- All Implemented Interfaces:
net.kyori.adventure.key.Keyed,VillagerType,ProtocolObject,StaticProtocolObject
public record VillagerTypeImpl(Registry.VillagerType registry, int id)
extends Record
implements VillagerType
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final VillagerTypestatic final VillagerTypestatic final VillagerTypestatic final VillagerTypestatic final VillagerTypestatic final VillagerTypestatic final VillagerType -
Constructor Summary
ConstructorsConstructorDescriptionVillagerTypeImpl(Registry.VillagerType registry) VillagerTypeImpl(Registry.VillagerType registry, int id) Creates an instance of aVillagerTypeImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.registry()Returns the value of theregistryrecord component.toString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minestom.server.registry.ProtocolObject
nameMethods inherited from interface net.minestom.server.entity.villager.VillagerType
key, namespace
-
Field Details
-
DESERT
-
JUNGLE
-
PLAINS
-
SAVANNA
-
SNOW
-
SWAMP
-
TAIGA
-
-
Constructor Details
-
VillagerTypeImpl
-
VillagerTypeImpl
Creates an instance of aVillagerTypeImplrecord class.- Parameters:
registry- the value for theregistryrecord componentid- the value for theidrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
registry
Returns the value of theregistryrecord component.- Specified by:
registryin interfaceVillagerType- Returns:
- the value of the
registryrecord component
-
id
public int id()Returns the value of theidrecord component.- Specified by:
idin interfaceStaticProtocolObject- Returns:
- the value of the
idrecord component
-