// 
// Decompiled by Procyon v0.6.0
// 

package com.hypixel.hytale.server.npc.asset.builder;

import com.hypixel.hytale.server.npc.asset.builder.validators.StringValidator;
import com.hypixel.hytale.server.npc.asset.builder.validators.StringNotEmptyValidator;
import javax.annotation.Nonnull;
import com.google.gson.JsonElement;
import com.hypixel.hytale.server.spawning.ISpawnable;

public abstract class BuilderBaseWithType<T> extends BuilderBase<T> implements ISpawnable
{
    private String type;
    
    @Override
    public Builder<T> readCommonConfig(final JsonElement data) {
        return super.readCommonConfig(data);
    }
    
    protected void readTypeKey(@Nonnull final JsonElement data, final String typeKey) {
        this.requireString(data, typeKey, s -> this.type = s, StringNotEmptyValidator.get(), BuilderDescriptorState.Stable, "Type field", null);
    }
    
    protected void readTypeKey(@Nonnull final JsonElement data) {
        this.readTypeKey(data, "Type");
    }
    
    public String getType() {
        return this.type;
    }
}
