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 R
put(@NotNull String key, @NotNull BinaryTag tag)
Inserts a tag.R
put(@NotNull Map<String,? extends BinaryTag> tags)
Inserts some tags.R
put(@NotNull CompoundBinaryTag tag)
Inserts the tags intag
, overwriting any that are inthis
.default R
putBoolean(@NotNull String key, boolean value)
Inserts a boolean.default R
putByte(@NotNull String key, byte value)
Inserts a byte.default R
putByteArray(@NotNull String key, byte @NotNull [] value)
Inserts an array of bytes.default R
putDouble(@NotNull String key, double value)
Inserts a double.default R
putFloat(@NotNull String key, float value)
Inserts a float.default R
putInt(@NotNull String key, int value)
Inserts an int.default R
putIntArray(@NotNull String key, int @NotNull [] value)
Inserts an array of ints.default R
putLong(@NotNull String key, long value)
Inserts a long.default R
putLongArray(@NotNull String key, long @NotNull [] value)
Inserts an array of longs.default R
putShort(@NotNull String key, short value)
Inserts a short.default R
putString(@NotNull String key, @NotNull String value)
Inserts a string.default R
remove(@NotNull String key)
Removes a tag.R
remove(@NotNull String key, @Nullable Consumer<? super BinaryTag> removed)
Removes a tag.
-
-
-
Method Detail
-
put
@NotNull R put(@NotNull @NotNull String key, @NotNull @NotNull BinaryTag tag)
Inserts a tag.- Parameters:
key
- the keytag
- the tag- Returns:
- a compound tag
- Since:
- 4.0.0
-
put
@NotNull R put(@NotNull @NotNull CompoundBinaryTag tag)
Inserts the tags intag
, overwriting any that are inthis
.- Parameters:
tag
- the tag- Returns:
- a compound tag
- Since:
- 4.6.0
-
put
@NotNull R put(@NotNull @NotNull Map<String,? extends BinaryTag> tags)
Inserts some tags.- Parameters:
tags
- the tags- Returns:
- a compound tag
- Since:
- 4.4.0
-
remove
@NotNull default R remove(@NotNull @NotNull String key)
Removes a tag.- Parameters:
key
- the key- Returns:
- a compound tag
- Since:
- 4.4.0
-
remove
@NotNull R remove(@NotNull @NotNull String key, @Nullable @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
@NotNull default R putBoolean(@NotNull @NotNull 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
@NotNull default R putByte(@NotNull @NotNull String key, byte value)
Inserts a byte.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putShort
@NotNull default R putShort(@NotNull @NotNull String key, short value)
Inserts a short.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putInt
@NotNull default R putInt(@NotNull @NotNull String key, int value)
Inserts an int.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putLong
@NotNull default R putLong(@NotNull @NotNull String key, long value)
Inserts a long.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putFloat
@NotNull default R putFloat(@NotNull @NotNull String key, float value)
Inserts a float.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putDouble
@NotNull default R putDouble(@NotNull @NotNull String key, double value)
Inserts a double.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putByteArray
@NotNull default R putByteArray(@NotNull @NotNull String key, byte @NotNull [] value)
Inserts an array of bytes.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putString
@NotNull default R putString(@NotNull @NotNull String key, @NotNull @NotNull String value)
Inserts a string.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putIntArray
@NotNull default R putIntArray(@NotNull @NotNull String key, int @NotNull [] value)
Inserts an array of ints.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
-