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

org.apache.gobblin.rest.Metric Maven / Gradle / Ivy

The newest version!

package org.apache.gobblin.rest;

import java.util.List;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
import com.linkedin.data.DataMap;
import com.linkedin.data.schema.PathSpec;
import com.linkedin.data.schema.RecordDataSchema;
import com.linkedin.data.schema.SchemaFormatType;
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.JavaCodeUtil", comments = "Rest.li Data Template. Generated from gobblin-rest-service/gobblin-rest-api/src/main/pegasus/org/apache/gobblin/rest/Metric.pdl.")
public class Metric
    extends RecordTemplate
{

    private final static Metric.Fields _fields = new Metric.Fields();
    private final static RecordDataSchema SCHEMA = ((RecordDataSchema) DataTemplateUtil.parseSchema("namespace org.apache.gobblin.rest/**Gobblin metric*/record Metric{/**Metric group*/group:string/**Metric name*/name:string/**Metric type*/type:enum MetricTypeEnum{COUNTER,METER,GAUGE}/**Metric value*/value:string}", SchemaFormatType.PDL));
    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(6, 0.75F), SCHEMA);
    }

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

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

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

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

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

    /**
     * Getter for group
     * 
     * @return
     *     Required field. Could be null for partial record.
     * @see Metric.Fields#group
     */
    @Nonnull
    public String getGroup() {
        return obtainDirect(FIELD_Group, String.class, GetMode.STRICT);
    }

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

    /**
     * Setter for group
     * 
     * @param value
     *     Must not be null. For more control, use setters with mode instead.
     * @see Metric.Fields#group
     */
    public Metric setGroup(
        @Nonnull
        String value) {
        putDirect(FIELD_Group, String.class, String.class, value, SetMode.DISALLOW_NULL);
        return this;
    }

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

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

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

    /**
     * Getter for name
     * 
     * @return
     *     Required field. Could be null for partial record.
     * @see Metric.Fields#name
     */
    @Nonnull
    public String getName() {
        return obtainDirect(FIELD_Name, String.class, GetMode.STRICT);
    }

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

    /**
     * Setter for name
     * 
     * @param value
     *     Must not be null. For more control, use setters with mode instead.
     * @see Metric.Fields#name
     */
    public Metric setName(
        @Nonnull
        String value) {
        putDirect(FIELD_Name, String.class, String.class, value, SetMode.DISALLOW_NULL);
        return this;
    }

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

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

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

    /**
     * Getter for type
     * 
     * @return
     *     Required field. Could be null for partial record.
     * @see Metric.Fields#type
     */
    @Nonnull
    public MetricTypeEnum getType() {
        return obtainDirect(FIELD_Type, MetricTypeEnum.class, GetMode.STRICT);
    }

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

    /**
     * Setter for type
     * 
     * @param value
     *     Must not be null. For more control, use setters with mode instead.
     * @see Metric.Fields#type
     */
    public Metric setType(
        @Nonnull
        MetricTypeEnum value) {
        putDirect(FIELD_Type, MetricTypeEnum.class, String.class, value, SetMode.DISALLOW_NULL);
        return this;
    }

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

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

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

    /**
     * Getter for value
     * 
     * @return
     *     Required field. Could be null for partial record.
     * @see Metric.Fields#value
     */
    @Nonnull
    public String getValue() {
        return obtainDirect(FIELD_Value, String.class, GetMode.STRICT);
    }

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

    /**
     * Setter for value
     * 
     * @param value
     *     Must not be null. For more control, use setters with mode instead.
     * @see Metric.Fields#value
     */
    public Metric setValue(
        @Nonnull
        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