Interface CompoundTagSetter<R>

Type Parameters:
R - the return type
All Known Subinterfaces:
CompoundBinaryTag, CompoundBinaryTag.Builder

public interface CompoundTagSetter<R>
Common methods between CompoundBinaryTag and CompoundBinaryTag.Builder.
Since:
4.0.0
  • Method Summary

    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.
    @NonNull R put​(@NonNull CompoundBinaryTag tag)
    Inserts the tags in tag, overwriting any that are in this.
    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 Details

    • put

      @NonNull R put​(@NonNull String key, @NonNull BinaryTag tag)
      Inserts a tag.
      Parameters:
      key - the key
      tag - the tag
      Returns:
      a compound tag
      Since:
      4.0.0
    • put

      @NonNull R put​(@NonNull CompoundBinaryTag tag)
      Inserts the tags in tag, overwriting any that are in this.
      Parameters:
      tag - the tag
      Returns:
      a compound tag
      Since:
      4.6.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 key
      removed - 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 of 0 for false and 1 for true.

      Parameters:
      key - the key
      value - 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 key
      value - 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 key
      value - 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 key
      value - 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 key
      value - 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 key
      value - 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 key
      value - 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 key
      value - 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 key
      value - 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 key
      value - the value
      Returns:
      a compound tag
      Since:
      4.0.0
    • putLongArray

      default @NonNull R putLongArray​(@NonNull String key, long @NonNull [] value)
      Inserts an array of longs.
      Parameters:
      key - the key
      value - the value
      Returns:
      a compound tag
      Since:
      4.0.0