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
  • Constructor Details

    • StringEnumProperty

      public StringEnumProperty(org.geysermc.geyser.api.util.Identifier identifier, List<String> values, int defaultIndex)
      Creates an instance of a StringEnumProperty record class.
      Parameters:
      identifier - the value for the identifier record component
      values - the value for the values record component
      defaultIndex - the value for the defaultIndex record component
    • StringEnumProperty

      public StringEnumProperty(org.geysermc.geyser.api.util.Identifier name, List<String> values, @Nullable String defaultValue)
  • Method Details

    • allBedrockValues

      public List<String> allBedrockValues()
      Specified by:
      allBedrockValues in interface AbstractEnumProperty<String>
    • indexOf

      public int indexOf(String value)
      Specified by:
      indexOf in interface AbstractEnumProperty<String>
    • defaultValue

      public @NonNull String defaultValue()
      Specified by:
      defaultValue in interface org.geysermc.geyser.api.entity.property.GeyserEntityProperty<String>
    • toString

      public final 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • identifier

      public org.geysermc.geyser.api.util.Identifier identifier()
      Returns the value of the identifier record component.
      Specified by:
      identifier in interface org.geysermc.geyser.api.entity.property.GeyserEntityProperty<String>
      Returns:
      the value of the identifier record component
    • values

      public List<String> values()
      Returns the value of the values record component.
      Specified by:
      values in interface org.geysermc.geyser.api.entity.property.type.GeyserStringEnumProperty
      Returns:
      the value of the values record component
    • defaultIndex

      public int defaultIndex()
      Returns the value of the defaultIndex record component.
      Specified by:
      defaultIndex in interface AbstractEnumProperty<String>
      Returns:
      the value of the defaultIndex record component