public abstract class Property<T extends Comparable<T>> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Property.Value<T extends Comparable<T>> |
Modifier and Type | Field and Description |
---|---|
private com.mojang.serialization.Codec<T> |
codec |
private Integer |
hashCodeCache |
private String |
name |
private Class<T> |
type |
private com.mojang.serialization.Codec<Property.Value<T>> |
valueCodec |
Modifier | Constructor and Description |
---|---|
protected |
Property(String name,
Class<T> type) |
Modifier and Type | Method and Description |
---|---|
int |
computeHashCode() |
Property.Value<T> |
createValue(State<?,?> state) |
Property.Value<T> |
createValue(T value) |
boolean |
equals(Object object) |
String |
getName() |
Class<T> |
getType() |
com.mojang.serialization.Codec<Property.Value<T>> |
getValueCodec() |
abstract Collection<T> |
getValues()
Returns all possible values the property can take.
|
int |
hashCode() |
abstract String |
name(T value) |
abstract Optional<T> |
parse(String name) |
Stream<Property.Value<T>> |
stream() |
String |
toString() |
private final Class<T extends Comparable<T>> type
private final String name
private Integer hashCodeCache
private final com.mojang.serialization.Codec<T extends Comparable<T>> codec
private final com.mojang.serialization.Codec<Property.Value<T extends Comparable<T>>> valueCodec
public Property.Value<T> createValue(T value)
public Property.Value<T> createValue(State<?,?> state)
public Stream<Property.Value<T>> stream()
public com.mojang.serialization.Codec<Property.Value<T>> getValueCodec()
public String getName()
public abstract Collection<T> getValues()
public int computeHashCode()