/**
 *
 */
package cn.citycraft.GsonAgent.nms;

import java.math.BigDecimal;
import java.math.BigInteger;

import cn.citycraft.GsonAgent.api.JsonElement;
import cn.citycraft.GsonAgent.api.utils.Utils;

/**
 * JsonElementHandler处理类
 *
 * @since 2016年1月5日 下午1:36:14
 * @author 喵♂呜
 */
public class JsonElementHandle implements JsonElement {

	private net.minecraft.util.com.google.gson.JsonElement handle;

	public JsonElementHandle() {
	}

	public JsonElementHandle(final net.minecraft.util.com.google.gson.JsonElement handle) {
		this.handle = handle;
	}

	@Override
	public cn.citycraft.GsonAgent.api.JsonElement deepCopy() {
		return new JsonElementHandle(Utils.deepCopyObject(this.getHandle()));
	}

	@Override
	public BigDecimal getAsBigDecimal() {
		return getHandle().getAsBigDecimal();
	}

	@Override
	public BigInteger getAsBigInteger() {
		return getHandle().getAsBigInteger();
	}

	@Override
	public boolean getAsBoolean() {
		return getHandle().getAsBoolean();
	}

	@Override
	public byte getAsByte() {
		return getHandle().getAsByte();
	}

	@Override
	public char getAsCharacter() {
		return getHandle().getAsCharacter();
	}

	@Override
	public double getAsDouble() {
		return getHandle().getAsDouble();
	}

	@Override
	public float getAsFloat() {
		return getHandle().getAsFloat();
	}

	@Override
	public int getAsInt() {
		return getHandle().getAsInt();
	}

	@Override
	public JsonArrayHandle getAsJsonArray() {
		return new JsonArrayHandle(getHandle().getAsJsonArray());
	}

	@Override
	public JsonNullHandle getAsJsonNull() {
		return new JsonNullHandle(getHandle().getAsJsonNull());
	}

	@Override
	public JsonObjectHandle getAsJsonObject() {
		return new JsonObjectHandle(getHandle().getAsJsonObject());
	}

	@Override
	public JsonPrimitiveHandle getAsJsonPrimitive() {
		return new JsonPrimitiveHandle(getHandle().getAsJsonPrimitive());
	}

	@Override
	public long getAsLong() {
		return getHandle().getAsLong();
	}

	@Override
	public Number getAsNumber() {
		return getHandle().getAsNumber();
	}

	@Override
	public short getAsShort() {
		return getHandle().getAsShort();
	}

	@Override
	public String getAsString() {
		return getHandle().getAsString();
	}

	public net.minecraft.util.com.google.gson.JsonElement getHandle() {
		return handle;
	}

	@Override
	public boolean isJsonArray() {
		return getHandle().isJsonArray();
	}

	@Override
	public boolean isJsonNull() {
		return getHandle().isJsonNull();
	}

	@Override
	public boolean isJsonObject() {
		return getHandle().isJsonObject();
	}

	@Override
	public boolean isJsonPrimitive() {
		return getHandle().isJsonPrimitive();
	}

	@Override
	public String toString() {
		return getHandle().toString();
	}

}
