Interface CompoundTagSetter<R>

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

public sealed interface CompoundTagSetter<R> permits CompoundBinaryTag, CompoundBinaryTag.Builder
Common methods between CompoundBinaryTag and CompoundBinaryTag.Builder.
Since:
4.0.0
  • Method Details

    • put

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

      R put(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

      R put(Map<String, ? extends BinaryTag> tags)
      Inserts some tags.
      Parameters:
      tags - the tags
      Returns:
      a compound tag
      Since:
      4.4.0
    • remove

      default R remove(String key)
      Removes a tag.
      Parameters:
      key - the key
      Returns:
      a compound tag
      Since:
      4.4.0
    • remove

      R remove(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 R putBoolean(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 R putByte(String key, byte value)
      Inserts a byte.
      Parameters:
      key - the key
      value - the value
      Returns:
      a compound tag
      Since:
      4.0.0
    • putShort

      default R putShort(String key, short value)
      Inserts a short.
      Parameters:
      key - the key
      value - the value
      Returns:
      a compound tag
      Since:
      4.0.0
    • putInt

      default R putInt(String key, int value)
      Inserts an int.
      Parameters:
      key - the key
      value - the value
      Returns:
      a compound tag
      Since:
      4.0.0
    • putLong

      default R putLong(String key, long value)
      Inserts a long.
      Parameters:
      key - the key
      value - the value
      Returns:
      a compound tag
      Since:
      4.0.0
    • putFloat

      default R putFloat(String key, float value)
      Inserts a float.
      Parameters:
      key - the key
      value - the value
      Returns:
      a compound tag
      Since:
      4.0.0
    • putDouble

      default R putDouble(String key, double value)
      Inserts a double.
      Parameters:
      key - the key
      value - the value
      Returns:
      a compound tag
      Since:
      4.0.0
    • putByteArray

      default R putByteArray(String key, byte[] value)
      Inserts an array of bytes.
      Parameters:
      key - the key
      value - the value
      Returns:
      a compound tag
      Since:
      4.0.0
    • putString

      default R putString(String key, String value)
      Inserts a string.
      Parameters:
      key - the key
      value - the value
      Returns:
      a compound tag
      Since:
      4.0.0
    • putIntArray

      default R putIntArray(String key, int[] value)
      Inserts an array of ints.
      Parameters:
      key - the key
      value - the value
      Returns:
      a compound tag
      Since:
      4.0.0
    • putLongArray

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