Record Class DataSource.Type<T extends DataSource>
java.lang.Object
java.lang.Record
net.minecraft.network.chat.contents.DataSource.Type<T>
- All Implemented Interfaces:
StringRepresentable
- Enclosing interface:
- DataSource
public static record DataSource.Type<T extends DataSource>(com.mojang.serialization.MapCodec<T extends DataSource> codec, String id)
extends Record
implements StringRepresentable
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.util.StringRepresentable
StringRepresentable.EnumCodec<E extends Enum<E> & StringRepresentable>, StringRepresentable.StringRepresentableCodec<S extends StringRepresentable>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.mojang.serialization.MapCodec<T>
The field for thecodec
record component.private final String
The field for theid
record component.Fields inherited from interface net.minecraft.util.StringRepresentable
PRE_BUILT_MAP_THRESHOLD
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<T>
codec()
Returns the value of thecodec
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.id()
Returns the value of theid
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
codec
The field for thecodec
record component. -
id
The field for theid
record component.
-
-
Constructor Details
-
Type
Creates an instance of aType
record class.- Parameters:
codec
- the value for thecodec
record componentid
- the value for theid
record component
-
-
Method Details
-
getSerializedName
- Specified by:
getSerializedName
in interfaceStringRepresentable
-
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. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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)
. -
codec
Returns the value of thecodec
record component.- Returns:
- the value of the
codec
record component
-
id
Returns the value of theid
record component.- Returns:
- the value of the
id
record component
-