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