com.intellectualcrafters.jnbt

## Class NBTUtils

- java.lang.Object
- - com.intellectualcrafters.jnbt.NBTUtils

-     public final class NBTUtils
      extends java.lang.Object

  A class which contains NBT-related utility methods.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T extends Tag> T` | `getChildTag(java.util.Map<java.lang.String,Tag> items, java.lang.String key, java.lang.Class<T> expected)` Get child tag of a NBT structure.
    `static java.lang.Class<? extends Tag>` | `getTypeClass(int type)` Gets the class of a type of tag.
    `static int` | `getTypeCode(java.lang.Class<? extends Tag> clazz)` Gets the type code of a tag class.
    `static java.lang.String` | `getTypeName(java.lang.Class<? extends Tag> clazz)` Gets the type name of a tag.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getTypeName

          public static java.lang.String getTypeName(java.lang.Class<? extends Tag> clazz)

      Gets the type name of a tag.
      Parameters:
        `clazz` - the tag class
      Returns:
        The type name.

    - #### getTypeCode

          public static int getTypeCode(java.lang.Class<? extends Tag> clazz)

      Gets the type code of a tag class.
      Parameters:
        `clazz` - the tag class
      Returns:
        The type code.
      Throws:
        `java.lang.IllegalArgumentException` - if the tag class is invalid.

    - #### getTypeClass

          public static java.lang.Class<? extends Tag> getTypeClass(int type)

      Gets the class of a type of tag.
      Parameters:
        `type` - the type
      Returns:
        The class.
      Throws:
        `java.lang.IllegalArgumentException` - if the tag type is invalid.

    - #### getChildTag

          public static <T extends Tag> T getChildTag(java.util.Map<java.lang.String,Tag> items,
                                      java.lang.String key,
                                      java.lang.Class<T> expected)
                                           throws java.lang.IllegalArgumentException

      Get child tag of a NBT structure.
      Parameters:
        `items` - the map to read from
        `key` - the key to look for
        `expected` - the expected NBT class type
      Returns:
        child tag
      Throws:
        `InvalidFormatException`
        `java.lang.IllegalArgumentException`