Record Class BlockProperty.Choice<E extends Enum<E>>
java.lang.Object
java.lang.Record
fr.fidorial.world.block.BlockProperty.Choice<E>
- Type Parameters:
E- the enum- Record Components:
name- the property nametype- the enumvalues- the accepted constants, in state order
- All Implemented Interfaces:
BlockProperty<E>
- Enclosing interface:
BlockProperty<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface BlockProperty
BlockProperty.Choice<E>, BlockProperty.Flag, BlockProperty.Range -
Field Summary
Fields inherited from interface BlockProperty
NAME -
Constructor Summary
Constructors -
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.name()Returns the value of thenamerecord component.Returns the name a value is written as.static <E extends Enum<E>>
BlockProperty.Choice<E> Returns a property accepting every constant of an enum.static <E extends Enum<E>>
BlockProperty.Choice<E> Returns a property accepting some constants of an enum.Returns the value written as a name,nullif none is.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.values()Returns the value of thevaluesrecord component.Methods inherited from interface BlockProperty
indexOf
-
Constructor Details
-
Choice
-
-
Method Details
-
of
Returns a property accepting every constant of an enum.- Type Parameters:
E- the enum- Parameters:
name- the property nametype- the enum- Returns:
- a property accepting every constant of an enum
- Since:
- 0.1.0
-
of
@SafeVarargs public static <E extends Enum<E>> BlockProperty.Choice<E> of(String name, Class<E> type, E... values) Returns a property accepting some constants of an enum.- Type Parameters:
E- the enum- Parameters:
name- the property nametype- the enumvalues- the accepted constants, in state order- Returns:
- a property accepting some constants of an enum
- Since:
- 0.1.0
-
nameOf
Description copied from interface:BlockPropertyReturns the name a value is written as.- Specified by:
nameOfin interfaceBlockProperty<E extends Enum<E>>- Parameters:
value- an accepted value- Returns:
- the name a value is written as
-
parse
Description copied from interface:BlockPropertyReturns the value written as a name,nullif none is.- Specified by:
parsein interfaceBlockProperty<E extends Enum<E>>- Parameters:
name- the written value- Returns:
- the value written as a name,
nullif none is
-
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). -
name
-
type
-
values
-