All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gobblin.rest.Metric Maven / Gradle / Ivy

The newest version!

package gobblin.rest;

import java.util.List;
import javax.annotation.Generated;
import com.linkedin.data.DataMap;
import com.linkedin.data.schema.PathSpec;
import com.linkedin.data.schema.RecordDataSchema;
import com.linkedin.data.template.DataTemplateUtil;
import com.linkedin.data.template.GetMode;
import com.linkedin.data.template.RecordTemplate;
import com.linkedin.data.template.SetMode;


/**
 * Gobblin metric
 * 
 */
@Generated(value = "com.linkedin.pegasus.generator.PegasusDataTemplateGenerator", comments = "LinkedIn Data Template. Generated from /Users/stakiar/Documents/idea_linkedin/gobblin-proxy_trunk/gobblin-github/gobblin-rest-service/gobblin-rest-api/src/main/pegasus/gobblin/rest/Metric.pdsc.", date = "Thu May 12 11:38:45 PDT 2016")
public class Metric
    extends RecordTemplate
{

    private final static Metric.Fields _fields = new Metric.Fields();
    private final static RecordDataSchema SCHEMA = ((RecordDataSchema) DataTemplateUtil.parseSchema("{\"type\":\"record\",\"name\":\"Metric\",\"namespace\":\"gobblin.rest\",\"doc\":\"Gobblin metric\",\"fields\":[{\"name\":\"group\",\"type\":\"string\",\"doc\":\"Metric group\"},{\"name\":\"name\",\"type\":\"string\",\"doc\":\"Metric name\"},{\"name\":\"type\",\"type\":{\"type\":\"enum\",\"name\":\"MetricTypeEnum\",\"symbols\":[\"COUNTER\",\"METER\",\"GAUGE\"]},\"doc\":\"Metric type\"},{\"name\":\"value\",\"type\":\"string\",\"doc\":\"Metric value\"}]}"));
    private final static RecordDataSchema.Field FIELD_Group = SCHEMA.getField("group");
    private final static RecordDataSchema.Field FIELD_Name = SCHEMA.getField("name");
    private final static RecordDataSchema.Field FIELD_Type = SCHEMA.getField("type");
    private final static RecordDataSchema.Field FIELD_Value = SCHEMA.getField("value");

    public Metric() {
        super(new DataMap(), SCHEMA);
    }

    public Metric(DataMap data) {
        super(data, SCHEMA);
    }

    public static Metric.Fields fields() {
        return _fields;
    }

    /**
     * Existence checker for group
     * 
     * @see Fields#group
     */
    public boolean hasGroup() {
        return contains(FIELD_Group);
    }

    /**
     * Remover for group
     * 
     * @see Fields#group
     */
    public void removeGroup() {
        remove(FIELD_Group);
    }

    /**
     * Getter for group
     * 
     * @see Fields#group
     */
    public String getGroup(GetMode mode) {
        return obtainDirect(FIELD_Group, String.class, mode);
    }

    /**
     * Getter for group
     * 
     * @see Fields#group
     */
    public String getGroup() {
        return getGroup(GetMode.STRICT);
    }

    /**
     * Setter for group
     * 
     * @see Fields#group
     */
    public Metric setGroup(String value, SetMode mode) {
        putDirect(FIELD_Group, String.class, String.class, value, mode);
        return this;
    }

    /**
     * Setter for group
     * 
     * @see Fields#group
     */
    public Metric setGroup(String value) {
        putDirect(FIELD_Group, String.class, String.class, value, SetMode.DISALLOW_NULL);
        return this;
    }

    /**
     * Existence checker for name
     * 
     * @see Fields#name
     */
    public boolean hasName() {
        return contains(FIELD_Name);
    }

    /**
     * Remover for name
     * 
     * @see Fields#name
     */
    public void removeName() {
        remove(FIELD_Name);
    }

    /**
     * Getter for name
     * 
     * @see Fields#name
     */
    public String getName(GetMode mode) {
        return obtainDirect(FIELD_Name, String.class, mode);
    }

    /**
     * Getter for name
     * 
     * @see Fields#name
     */
    public String getName() {
        return getName(GetMode.STRICT);
    }

    /**
     * Setter for name
     * 
     * @see Fields#name
     */
    public Metric setName(String value, SetMode mode) {
        putDirect(FIELD_Name, String.class, String.class, value, mode);
        return this;
    }

    /**
     * Setter for name
     * 
     * @see Fields#name
     */
    public Metric setName(String value) {
        putDirect(FIELD_Name, String.class, String.class, value, SetMode.DISALLOW_NULL);
        return this;
    }

    /**
     * Existence checker for type
     * 
     * @see Fields#type
     */
    public boolean hasType() {
        return contains(FIELD_Type);
    }

    /**
     * Remover for type
     * 
     * @see Fields#type
     */
    public void removeType() {
        remove(FIELD_Type);
    }

    /**
     * Getter for type
     * 
     * @see Fields#type
     */
    public MetricTypeEnum getType(GetMode mode) {
        return obtainDirect(FIELD_Type, MetricTypeEnum.class, mode);
    }

    /**
     * Getter for type
     * 
     * @see Fields#type
     */
    public MetricTypeEnum getType() {
        return getType(GetMode.STRICT);
    }

    /**
     * Setter for type
     * 
     * @see Fields#type
     */
    public Metric setType(MetricTypeEnum value, SetMode mode) {
        putDirect(FIELD_Type, MetricTypeEnum.class, String.class, value, mode);
        return this;
    }

    /**
     * Setter for type
     * 
     * @see Fields#type
     */
    public Metric setType(MetricTypeEnum value) {
        putDirect(FIELD_Type, MetricTypeEnum.class, String.class, value, SetMode.DISALLOW_NULL);
        return this;
    }

    /**
     * Existence checker for value
     * 
     * @see Fields#value
     */
    public boolean hasValue() {
        return contains(FIELD_Value);
    }

    /**
     * Remover for value
     * 
     * @see Fields#value
     */
    public void removeValue() {
        remove(FIELD_Value);
    }

    /**
     * Getter for value
     * 
     * @see Fields#value
     */
    public String getValue(GetMode mode) {
        return obtainDirect(FIELD_Value, String.class, mode);
    }

    /**
     * Getter for value
     * 
     * @see Fields#value
     */
    public String getValue() {
        return getValue(GetMode.STRICT);
    }

    /**
     * Setter for value
     * 
     * @see Fields#value
     */
    public Metric setValue(String value, SetMode mode) {
        putDirect(FIELD_Value, String.class, String.class, value, mode);
        return this;
    }

    /**
     * Setter for value
     * 
     * @see Fields#value
     */
    public Metric setValue(String value) {
        putDirect(FIELD_Value, String.class, String.class, value, SetMode.DISALLOW_NULL);
        return this;
    }

    @Override
    public Metric clone()
        throws CloneNotSupportedException
    {
        return ((Metric) super.clone());
    }

    @Override
    public Metric copy()
        throws CloneNotSupportedException
    {
        return ((Metric) super.copy());
    }

    public static class Fields
        extends PathSpec
    {


        public Fields(List path, String name) {
            super(path, name);
        }

        public Fields() {
            super();
        }

        /**
         * Metric group
         * 
         */
        public PathSpec group() {
            return new PathSpec(getPathComponents(), "group");
        }

        /**
         * Metric name
         * 
         */
        public PathSpec name() {
            return new PathSpec(getPathComponents(), "name");
        }

        /**
         * Metric type
         * 
         */
        public PathSpec type() {
            return new PathSpec(getPathComponents(), "type");
        }

        /**
         * Metric value
         * 
         */
        public PathSpec value() {
            return new PathSpec(getPathComponents(), "value");
        }

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy