Record Class StringEnumProperty
java.lang.Object
java.lang.Record
org.geysermc.geyser.entity.properties.type.StringEnumProperty
- All Implemented Interfaces:
org.geysermc.geyser.api.entity.property.GeyserEntityProperty<String>,org.geysermc.geyser.api.entity.property.type.GeyserStringEnumProperty,AbstractEnumProperty<String>,PropertyType<String,org.cloudburstmc.protocol.bedrock.data.entity.IntEntityProperty>
public record StringEnumProperty(org.geysermc.geyser.api.util.Identifier identifier, List<String> values, int defaultIndex)
extends Record
implements AbstractEnumProperty<String>, org.geysermc.geyser.api.entity.property.type.GeyserStringEnumProperty
-
Field Summary
Fields inherited from interface org.geysermc.geyser.entity.properties.type.AbstractEnumProperty
VALUE_VALIDATION_REGEX -
Constructor Summary
ConstructorsConstructorDescriptionStringEnumProperty(org.geysermc.geyser.api.util.Identifier identifier, List<String> values, int defaultIndex) Creates an instance of aStringEnumPropertyrecord class.StringEnumProperty(org.geysermc.geyser.api.util.Identifier name, List<String> values, @Nullable String defaultValue) -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thedefaultIndexrecord component.@NonNull Stringfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.org.geysermc.geyser.api.util.IdentifierReturns the value of theidentifierrecord component.intfinal StringtoString()Returns a string representation of this record class.values()Returns the value of thevaluesrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.geysermc.geyser.entity.properties.type.AbstractEnumProperty
createValue, defaultValue, nbtMap, validateAllValuesMethods inherited from interface org.geysermc.geyser.entity.properties.type.PropertyType
apply
-
Constructor Details
-
StringEnumProperty
public StringEnumProperty(org.geysermc.geyser.api.util.Identifier identifier, List<String> values, int defaultIndex) Creates an instance of aStringEnumPropertyrecord class.- Parameters:
identifier- the value for theidentifierrecord componentvalues- the value for thevaluesrecord componentdefaultIndex- the value for thedefaultIndexrecord component
-
StringEnumProperty
-
-
Method Details
-
allBedrockValues
- Specified by:
allBedrockValuesin interfaceAbstractEnumProperty<String>
-
indexOf
- Specified by:
indexOfin interfaceAbstractEnumProperty<String>
-
defaultValue
- Specified by:
defaultValuein interfaceorg.geysermc.geyser.api.entity.property.GeyserEntityProperty<String>
-
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 '=='. -
identifier
public org.geysermc.geyser.api.util.Identifier identifier()Returns the value of theidentifierrecord component.- Specified by:
identifierin interfaceorg.geysermc.geyser.api.entity.property.GeyserEntityProperty<String>- Returns:
- the value of the
identifierrecord component
-
values
Returns the value of thevaluesrecord component.- Specified by:
valuesin interfaceorg.geysermc.geyser.api.entity.property.type.GeyserStringEnumProperty- Returns:
- the value of the
valuesrecord component
-
defaultIndex
public int defaultIndex()Returns the value of thedefaultIndexrecord component.- Specified by:
defaultIndexin interfaceAbstractEnumProperty<String>- Returns:
- the value of the
defaultIndexrecord component
-