Package com.pixelmonmod.pixelmon.api.ui
Record Class InputElementType<T extends InputType<?>>
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.ui.InputElementType<T>
public record InputElementType<T extends InputType<?>>(com.mojang.serialization.Codec<T extends InputType<?>> codec, InputElementType.Data<?,?> data)
extends Record
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
InputElementType.Data<T extends InputType<A>,
A> -
Constructor Summary
ConstructorDescriptionInputElementType
(com.mojang.serialization.Codec<T> codec) InputElementType
(com.mojang.serialization.Codec<T> codec, InputElementType.Data<?, ?> data) Creates an instance of aInputElementType
record class.InputElementType
(com.mojang.serialization.Codec<T> codec, Class<B> clazz, BiFunction<B, net.minecraft.network.chat.Component, A> constructor) InputElementType
(com.mojang.serialization.Codec<T> codec, Type type, BiFunction<B, net.minecraft.network.chat.Component, A> constructor) -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<T>
codec()
Returns the value of thecodec
record component.<A extends InputType<B>,
B>
Aconstruct
(B value, net.minecraft.network.chat.Component label) data()
Returns the value of thedata
record component.boolean
Indicates whether some other object is "equal to" this one.int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
InputElementType
public InputElementType(com.mojang.serialization.Codec<T> codec, Class<B> clazz, BiFunction<B, net.minecraft.network.chat.Component, A> constructor) -
InputElementType
public InputElementType(com.mojang.serialization.Codec<T> codec, Type type, BiFunction<B, net.minecraft.network.chat.Component, A> constructor) -
InputElementType
-
InputElementType
Creates an instance of aInputElementType
record class.- Parameters:
codec
- the value for thecodec
record componentdata
- the value for thedata
record component
-
-
Method Details
-
construct
-
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)
. -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
codec
Returns the value of thecodec
record component.- Returns:
- the value of the
codec
record component
-
data
Returns the value of thedata
record component.- Returns:
- the value of the
data
record component
-