Record Class BlockProperty.Range
java.lang.Object
java.lang.Record
fr.fidorial.world.block.BlockProperty.Range
- Record Components:
name- the property namemin- the lowest value,0or moremax- the highest value, abovemin
- All Implemented Interfaces:
BlockProperty<Integer>
- Enclosing interface:
BlockProperty<T>
public static record BlockProperty.Range(String name, int min, int max)
extends Record
implements BlockProperty<Integer>
A property taking every integer from
min to max.- Since:
- 0.1.0
-
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.intReturns the position of a value inBlockProperty.values(),-1if it is not accepted.intmax()Returns the value of themaxrecord component.intmin()Returns the value of theminrecord component.name()Returns the value of thenamerecord component.Returns the name a value is written as.Returns the value written as a name,nullif none is.final StringtoString()Returns a string representation of this record class.values()Returns the accepted values, at least two, in state order.
-
Constructor Details
-
Range
-
-
Method Details
-
values
Description copied from interface:BlockPropertyReturns the accepted values, at least two, in state order.- Specified by:
valuesin interfaceBlockProperty<Integer>- Returns:
- the accepted values, at least two, in state order
-
indexOf
Description copied from interface:BlockPropertyReturns the position of a value inBlockProperty.values(),-1if it is not accepted.- Specified by:
indexOfin interfaceBlockProperty<Integer>- Parameters:
value- the value- Returns:
- the position of a value in
BlockProperty.values(),-1if it is not accepted
-
nameOf
Description copied from interface:BlockPropertyReturns the name a value is written as.- Specified by:
nameOfin interfaceBlockProperty<Integer>- 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<Integer>- 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
name
-
min
-
max
-