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 betweenCompoundBinaryTagandCompoundBinaryTag.Builder.- Since:
- 4.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Rput(@NotNull java.lang.String key, @NotNull BinaryTag tag)Inserts a tag.Rput(@NotNull java.util.Map<java.lang.String,? extends BinaryTag> tags)Inserts some tags.Rput(@NotNull CompoundBinaryTag tag)Inserts the tags intag, overwriting any that are inthis.default RputBoolean(@NotNull java.lang.String key, boolean value)Inserts a boolean.default RputByte(@NotNull java.lang.String key, byte value)Inserts a byte.default RputByteArray(@NotNull java.lang.String key, byte @NotNull [] value)Inserts an array of bytes.default RputDouble(@NotNull java.lang.String key, double value)Inserts a double.default RputFloat(@NotNull java.lang.String key, float value)Inserts a float.default RputInt(@NotNull java.lang.String key, int value)Inserts an int.default RputIntArray(@NotNull java.lang.String key, int @NotNull [] value)Inserts an array of ints.default RputLong(@NotNull java.lang.String key, long value)Inserts a long.default RputLongArray(@NotNull java.lang.String key, long @NotNull [] value)Inserts an array of longs.default RputShort(@NotNull java.lang.String key, short value)Inserts a short.default RputString(@NotNull java.lang.String key, @NotNull java.lang.String value)Inserts a string.default Rremove(@NotNull java.lang.String key)Removes a tag.Rremove(@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
ByteBinaryTagwith a value of0forfalseand1fortrue.- 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
-
-