Record Class TagImpl<T>
java.lang.Object
java.lang.Record
net.minestom.server.tag.TagImpl<T>
- All Implemented Interfaces:
Tag<T>
public record TagImpl<T>(int index, String key, Function<?,?> readComparator, net.minestom.server.tag.Serializers.Entry<T, BinaryTag> entry, @Nullable Supplier<@Nullable T> defaultValue, TagImpl.PathEntry @Nullable [] path, @Nullable UnaryOperator<T> copy, int listScope)
extends Record
implements Tag<T>
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionTagImpl(int index, String key, Function<?, ?> readComparator, net.minestom.server.tag.Serializers.Entry<T, BinaryTag> entry, @Nullable Supplier<@Nullable T> defaultValue, TagImpl.PathEntry @Nullable [] path, @Nullable UnaryOperator<T> copy, int listScope) Creates an instance of aTagImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns the value of thecopyrecord component.Returns the value of thedefaultValuerecord component.defaultValue(Supplier<T> defaultValue) defaultValue(T defaultValue) entry()Returns the value of theentryrecord component.booleanIndicates whether some other object is "equal to" this one.getKey()UseTag.key()insteadinthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.booleanisView()key()Returns the value of thekeyrecord component.list()intReturns the value of thelistScoperecord component.<R extends @UnknownNullability Object>
Tag<R> path()Returns the value of thepathrecord component.read(CompoundBinaryTag nbt) Function<?, ?> Returns the value of thereadComparatorrecord component.booleanshareValue(Tag<?> other) final StringtoString()Returns a string representation of this record class.voidwrite(CompoundBinaryTag.Builder nbtCompound, T value) voidwriteUnsafe(CompoundBinaryTag.Builder nbtCompound, @Nullable Object value)
-
Constructor Details
-
TagImpl
public TagImpl(int index, String key, Function<?, ?> readComparator, net.minestom.server.tag.Serializers.Entry<T, BinaryTag> entry, @Nullable @Nullable Supplier<@Nullable T> defaultValue, TagImpl.PathEntry @Nullable [] path, @Nullable @Nullable UnaryOperator<T> copy, int listScope) Creates an instance of aTagImplrecord class.- Parameters:
index- the value for theindexrecord componentkey- the value for thekeyrecord componentreadComparator- the value for thereadComparatorrecord componententry- the value for theentryrecord componentdefaultValue- the value for thedefaultValuerecord componentpath- the value for thepathrecord componentcopy- the value for thecopyrecord componentlistScope- the value for thelistScoperecord component
-
-
Method Details
-
getKey
-
key
-
defaultValue
-
defaultValue
-
map
-
list
-
path
-
read
-
write
-
writeUnsafe
- Specified by:
writeUnsafein interfaceTag<T>
-
isView
-
createDefault
- Specified by:
createDefaultin interfaceTag<T>
-
copyValue
-
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. -
hashCode
-
toString
-
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-
readComparator
Returns the value of thereadComparatorrecord component.- Returns:
- the value of the
readComparatorrecord component
-
entry
-
defaultValue
-
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-
copy
Returns the value of thecopyrecord component.- Returns:
- the value of the
copyrecord component
-
listScope
public int listScope()Returns the value of thelistScoperecord component.- Returns:
- the value of the
listScoperecord component
-