<commit_before>package org.inventivetalent.nbt;

public class TagID {

	public static final int TAG_END        = 0;
	public static final int TAG_BYTE       = 1;
	public static final int TAG_SHORT      = 2;
	public static final int TAG_INT        = 3;
	public static final int TAG_LONG       = 4;
	public static final int TAG_FLOAT      = 5;
	public static final int TAG_DOUBLE     = 6;
	public static final int TAG_BYTE_ARRAY = 7;
	public static final int TAG_STRING     = 8;
	public static final int TAG_LIST       = 9;
	public static final int TAG_COMPOUND   = 10;
	public static final int TAG_INT_ARRAY  = 11;

	public static int forClass(Class<? extends NBTTag> clazz) {
		return forName(clazz.getSimpleName());
	}

	public static int forValueClass(Class<?> clazz) {
		if (byte.class.isAssignableFrom(clazz) || boolean.class.isAssignableFrom(clazz)) {
			return TAG_BYTE;
		}
		if (short.class.isAssignableFrom(clazz)) {
			return TAG_SHORT;
		}
		if (int.class.isAssignableFrom(clazz)) {
			return TAG_INT;
		}
		if (long.class.isAssignableFrom(clazz)) {
			return TAG_LONG;
		}
		if (float.class.isAssignableFrom(clazz)) {
			return TAG_FLOAT;
		}
		if (double.class.isAssignableFrom(clazz)) {
			return TAG_DOUBLE;
		}
		if (String.class.isAssignableFrom(clazz)) {
			return TAG_STRING;
		}
		if (byte[].class.isAssignableFrom(clazz)) {
			return TAG_BYTE_ARRAY;
		}
		if (int[].class.isAssignableFrom(clazz)) {
			return TAG_INT_ARRAY;
		}
		return -1;
	}

	public static int forName(String name) {
		switch (name) {
			case "ByteArrayTag":
			case "Tag_Byte_Array":
				return TAG_BYTE_ARRAY;
			case "ByteTag":
			case "Tag_Byte":
				return TAG_BYTE;
			case "CompoundTag":
			case "TAG_Compound":
				return TAG_COMPOUND;
			case "DoubleTag":
			case "TAG_Double":
				return TAG_DOUBLE;
			case "EndTag":
			case "TAG_End":
				return TAG_END;
			case "FloatTag":
			case "TAG_Float":<commit_msg>add wrapper class support<commit_after>package org.inventivetalent.nbt;

public class TagID {

	public static final int TAG_END        = 0;
	public static final int TAG_BYTE       = 1;
	public static final int TAG_SHORT      = 2;
	public static final int TAG_INT        = 3;
	public static final int TAG_LONG       = 4;
	public static final int TAG_FLOAT      = 5;
	public static final int TAG_DOUBLE     = 6;
	public static final int TAG_BYTE_ARRAY = 7;
	public static final int TAG_STRING     = 8;
	public static final int TAG_LIST       = 9;
	public static final int TAG_COMPOUND   = 10;
	public static final int TAG_INT_ARRAY  = 11;

	public static int forClass(Class<? extends NBTTag> clazz) {
		return forName(clazz.getSimpleName());
	}

	public static int forValueClass(Class<?> clazz) {
		if (byte.class.isAssignableFrom(clazz) || Byte.class.isAssignableFrom(clazz) || boolean.class.isAssignableFrom(clazz)) {
			return TAG_BYTE;
		}
		if (short.class.isAssignableFrom(clazz) || Short.class.isAssignableFrom(clazz)) {
			return TAG_SHORT;
		}
		if (int.class.isAssignableFrom(clazz) || Integer.class.isAssignableFrom(clazz)) {
			return TAG_INT;
		}
		if (long.class.isAssignableFrom(clazz) || Long.class.isAssignableFrom(clazz)) {
			return TAG_LONG;
		}
		if (float.class.isAssignableFrom(clazz) || Float.class.isAssignableFrom(clazz)) {
			return TAG_FLOAT;
		}
		if (double.class.isAssignableFrom(clazz) || Double.class.isAssignableFrom(clazz)) {
			return TAG_DOUBLE;
		}
		if (String.class.isAssignableFrom(clazz)) {
			return TAG_STRING;
		}
		if (byte[].class.isAssignableFrom(clazz) || Byte[].class.isAssignableFrom(clazz)) {
			return TAG_BYTE_ARRAY;
		}
		if (int[].class.isAssignableFrom(clazz) || Integer[].class.isAssignableFrom(clazz)) {
			return TAG_INT_ARRAY;
		}
		return -1;
	}

	public static int forName(String name) {
		switch (name) {
			case "ByteArrayTag":
			case "Tag_Byte_Array":
				return TAG_BYTE_ARRAY;
			case "ByteTag":
			case "Tag_Byte":
				return TAG_BYTE;
			case "CompoundTag":
			case "TAG_Compound":
				return TAG_COMPOUND;
			case "DoubleTag":
			case "TAG_Double":
				return TAG_DOUBLE;
			case "EndTag":
			case "TAG_End":
				return TAG_END;
			case "FloatTag":
			case "TAG_Float":
{'fraction_non_alphanumeric': 0.10462873674059787, 'fraction_numerical': 0.007232401157184185, 'mean_word_length': 3.61, 'pattern_counts': {'":': 24, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2973118', 'n_tokens_mistral': 1684, 'n_tokens_neox': 1437, 'n_words': 352}