Package net.kyori.adventure.nbt
Interface CompoundTagSetter<R>
-
- Type Parameters:
R
- the return type
- All Known Subinterfaces:
CompoundBinaryTag
,CompoundBinaryTag.Builder
public interface CompoundTagSetter<R>
Common methods betweenCompoundBinaryTag
andCompoundBinaryTag.Builder
.- Since:
- 4.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description @NonNull R
put(@NonNull String key, @NonNull BinaryTag tag)
Inserts a tag.@NonNull R
put(@NonNull Map<String,? extends BinaryTag> tags)
Inserts some tags.default @NonNull R
putBoolean(@NonNull String key, boolean value)
Inserts a boolean.default @NonNull R
putByte(@NonNull String key, byte value)
Inserts a byte.default @NonNull R
putByteArray(@NonNull String key, byte @NonNull [] value)
Inserts an array of bytes.default @NonNull R
putDouble(@NonNull String key, double value)
Inserts a double.default @NonNull R
putFloat(@NonNull String key, float value)
Inserts a float.default @NonNull R
putInt(@NonNull String key, int value)
Inserts an int.default @NonNull R
putIntArray(@NonNull String key, int @NonNull [] value)
Inserts an array of ints.default @NonNull R
putLong(@NonNull String key, long value)
Inserts a long.default @NonNull R
putLongArray(@NonNull String key, long @NonNull [] value)
Inserts an array of longs.default @NonNull R
putShort(@NonNull String key, short value)
Inserts a short.default @NonNull R
putString(@NonNull String key, @NonNull String value)
Inserts a string.default @NonNull R
remove(@NonNull String key)
Removes a tag.@NonNull R
remove(@NonNull String key, @Nullable Consumer<? super BinaryTag> removed)
Removes a tag.
-
-
-
Method Detail
-
put
@NonNull R put(@NonNull String key, @NonNull BinaryTag tag)
Inserts a tag.- Parameters:
key
- the keytag
- the tag- Returns:
- a compound tag
- Since:
- 4.0.0
-
put
@NonNull R put(@NonNull Map<String,? extends BinaryTag> tags)
Inserts some tags.- Parameters:
tags
- the tags- Returns:
- a compound tag
- Since:
- 4.4.0
-
remove
default @NonNull R remove(@NonNull String key)
Removes a tag.- Parameters:
key
- the key- Returns:
- a compound tag
- Since:
- 4.4.0
-
remove
@NonNull R remove(@NonNull String key, @Nullable Consumer<? super BinaryTag> removed)
Removes a tag.- Parameters:
key
- the keyremoved
- a consumer that accepts the removed tag- Returns:
- a compound tag
- Since:
- 4.4.0
-
putBoolean
default @NonNull R putBoolean(@NonNull String key, boolean value)
Inserts a boolean.Booleans are stored as a
ByteBinaryTag
with a value of0
forfalse
and1
fortrue
.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putByte
default @NonNull R putByte(@NonNull String key, byte value)
Inserts a byte.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putShort
default @NonNull R putShort(@NonNull String key, short value)
Inserts a short.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putInt
default @NonNull R putInt(@NonNull String key, int value)
Inserts an int.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putLong
default @NonNull R putLong(@NonNull String key, long value)
Inserts a long.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putFloat
default @NonNull R putFloat(@NonNull String key, float value)
Inserts a float.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putDouble
default @NonNull R putDouble(@NonNull String key, double value)
Inserts a double.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putByteArray
default @NonNull R putByteArray(@NonNull String key, byte @NonNull [] value)
Inserts an array of bytes.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putString
default @NonNull R putString(@NonNull String key, @NonNull String value)
Inserts a string.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putIntArray
default @NonNull R putIntArray(@NonNull String key, int @NonNull [] value)
Inserts an array of ints.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
-