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

com.linkedin.restli.restspec.AlternativeKeySchema Maven / Gradle / Ivy


package com.linkedin.restli.restspec;

import java.util.List;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
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;


/**
 * 
 * 
 */
@Generated(value = "com.linkedin.pegasus.generator.JavaCodeUtil", comments = "Rest.li Data Template. Generated from /Users/mnchen/dev/pegasus_trunk/pegasus/restli-common/src/main/pegasus/com/linkedin/restli/restspec/AlternativeKeySchema.pdsc.", date = "Tue Oct 03 15:15:24 PDT 2017")
public class AlternativeKeySchema
    extends RecordTemplate
{

    private final static AlternativeKeySchema.Fields _fields = new AlternativeKeySchema.Fields();
    private final static RecordDataSchema SCHEMA = ((RecordDataSchema) DataTemplateUtil.parseSchema("{\"type\":\"record\",\"name\":\"AlternativeKeySchema\",\"namespace\":\"com.linkedin.restli.restspec\",\"fields\":[{\"name\":\"name\",\"type\":\"string\",\"doc\":\"Name of the alternative key\"},{\"name\":\"doc\",\"type\":\"string\",\"doc\":\"Documentation for the alternative key\",\"optional\":true},{\"name\":\"type\",\"type\":\"string\",\"doc\":\"the avro type of the alternative key\"},{\"name\":\"keyCoercer\",\"type\":\"string\",\"doc\":\"the keyCoercer class for this alternative key\"}]}"));
    private final static RecordDataSchema.Field FIELD_Name = SCHEMA.getField("name");
    private final static RecordDataSchema.Field FIELD_Doc = SCHEMA.getField("doc");
    private final static RecordDataSchema.Field FIELD_Type = SCHEMA.getField("type");
    private final static RecordDataSchema.Field FIELD_KeyCoercer = SCHEMA.getField("keyCoercer");

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

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

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

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

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

    /**
     * Getter for name
     * 
     * @see AlternativeKeySchema.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 AlternativeKeySchema.Fields#name
     */
    @Nonnull
    public String getName() {
        return obtainDirect(FIELD_Name, String.class, GetMode.STRICT);
    }

    /**
     * Setter for name
     * 
     * @see AlternativeKeySchema.Fields#name
     */
    public AlternativeKeySchema 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 AlternativeKeySchema.Fields#name
     */
    public AlternativeKeySchema setName(
        @Nonnull
        String value) {
        putDirect(FIELD_Name, String.class, String.class, value, SetMode.DISALLOW_NULL);
        return this;
    }

    /**
     * Existence checker for doc
     * 
     * @see AlternativeKeySchema.Fields#doc
     */
    public boolean hasDoc() {
        return contains(FIELD_Doc);
    }

    /**
     * Remover for doc
     * 
     * @see AlternativeKeySchema.Fields#doc
     */
    public void removeDoc() {
        remove(FIELD_Doc);
    }

    /**
     * Getter for doc
     * 
     * @see AlternativeKeySchema.Fields#doc
     */
    public String getDoc(GetMode mode) {
        return obtainDirect(FIELD_Doc, String.class, mode);
    }

    /**
     * Getter for doc
     * 
     * @return
     *     Optional field. Always check for null.
     * @see AlternativeKeySchema.Fields#doc
     */
    @Nullable
    public String getDoc() {
        return obtainDirect(FIELD_Doc, String.class, GetMode.STRICT);
    }

    /**
     * Setter for doc
     * 
     * @see AlternativeKeySchema.Fields#doc
     */
    public AlternativeKeySchema setDoc(String value, SetMode mode) {
        putDirect(FIELD_Doc, String.class, String.class, value, mode);
        return this;
    }

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

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

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

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

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

    /**
     * Setter for type
     * 
     * @see AlternativeKeySchema.Fields#type
     */
    public AlternativeKeySchema setType(String value, SetMode mode) {
        putDirect(FIELD_Type, String.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 AlternativeKeySchema.Fields#type
     */
    public AlternativeKeySchema setType(
        @Nonnull
        String value) {
        putDirect(FIELD_Type, String.class, String.class, value, SetMode.DISALLOW_NULL);
        return this;
    }

    /**
     * Existence checker for keyCoercer
     * 
     * @see AlternativeKeySchema.Fields#keyCoercer
     */
    public boolean hasKeyCoercer() {
        return contains(FIELD_KeyCoercer);
    }

    /**
     * Remover for keyCoercer
     * 
     * @see AlternativeKeySchema.Fields#keyCoercer
     */
    public void removeKeyCoercer() {
        remove(FIELD_KeyCoercer);
    }

    /**
     * Getter for keyCoercer
     * 
     * @see AlternativeKeySchema.Fields#keyCoercer
     */
    public String getKeyCoercer(GetMode mode) {
        return obtainDirect(FIELD_KeyCoercer, String.class, mode);
    }

    /**
     * Getter for keyCoercer
     * 
     * @return
     *     Required field. Could be null for partial record.
     * @see AlternativeKeySchema.Fields#keyCoercer
     */
    @Nonnull
    public String getKeyCoercer() {
        return obtainDirect(FIELD_KeyCoercer, String.class, GetMode.STRICT);
    }

    /**
     * Setter for keyCoercer
     * 
     * @see AlternativeKeySchema.Fields#keyCoercer
     */
    public AlternativeKeySchema setKeyCoercer(String value, SetMode mode) {
        putDirect(FIELD_KeyCoercer, String.class, String.class, value, mode);
        return this;
    }

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

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

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

    public static class Fields
        extends PathSpec
    {


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

        public Fields() {
            super();
        }

        /**
         * Name of the alternative key
         * 
         */
        public PathSpec name() {
            return new PathSpec(getPathComponents(), "name");
        }

        /**
         * Documentation for the alternative key
         * 
         */
        public PathSpec doc() {
            return new PathSpec(getPathComponents(), "doc");
        }

        /**
         * the avro type of the alternative key
         * 
         */
        public PathSpec type() {
            return new PathSpec(getPathComponents(), "type");
        }

        /**
         * the keyCoercer class for this alternative key
         * 
         */
        public PathSpec keyCoercer() {
            return new PathSpec(getPathComponents(), "keyCoercer");
        }

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy