Interface BlockProperty<T>
- Type Parameters:
T- the type of the values
- All Known Implementing Classes:
BlockProperty.Choice, BlockProperty.Flag, BlockProperty.Range
public sealed interface BlockProperty<T>
permits BlockProperty.Flag, BlockProperty.Range, BlockProperty.Choice<E>
A property of a block type and the values its states take, in state order.
- Since:
- 0.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordBlockProperty.Choice<E extends Enum<E>>A property taking some constants of an enum, each written as its lowercased name.static final recordA property that is eithertrueorfalse.static final recordA property taking every integer frommintomax. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault intReturns the position of a value invalues(),-1if it is not accepted.name()Returns the property name, for instancefacing.Returns the name a value is written as.Returns the value written as a name,nullif none is.values()Returns the accepted values, at least two, in state order.
-
Field Details
-
NAME
-
-
Method Details
-
name
String name()Returns the property name, for instancefacing.- Returns:
- the property name, for instance
facing - Since:
- 0.1.0
-
values
-
nameOf
Returns the name a value is written as.- Parameters:
value- an accepted value- Returns:
- the name a value is written as
- Throws:
IllegalArgumentException- if the value is not accepted- Since:
- 0.1.0
-
parse
-
indexOf
-