Android Open Source - Pipe Ad Request






From Project

Back to project page Pipe.

License

The source code is released under:

MIT License

If you think the Android project Pipe listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.westudio.android.protocol;
//from  w w  w  .  j a v  a 2s.c o m
/**
 * Autogenerated by Avro
 *
 * DO NOT EDIT DIRECTLY
 */
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class AdRequest extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
    public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"AdRequest\",\"namespace\":\"com.westudio.java.protocol.v1\",\"fields\":[{\"name\":\"adBB\",\"type\":\"string\"},{\"name\":\"person\",\"type\":{\"type\":\"record\",\"name\":\"Person\",\"fields\":[{\"name\":\"id\",\"type\":\"int\",\"default\":0},{\"name\":\"lastName\",\"type\":\"string\"},{\"name\":\"postCode\",\"type\":\"string\"},{\"name\":\"address1\",\"type\":\"string\"},{\"name\":\"address2\",\"type\":\"string\"},{\"name\":\"firstName\",\"type\":\"string\"},{\"name\":\"country\",\"type\":\"string\"},{\"name\":\"city\",\"type\":\"string\"}]},\"default\":\"null\"}]}");
    public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
    @Deprecated public CharSequence adBB;
    @Deprecated public Person person;

    /**
     * Default constructor.  Note that this does not initialize fields
     * to their default values from the schema.  If that is desired then
     * one should use <code>newBuilder()</code>.
     */
    public AdRequest() {}

    /**
     * All-args constructor.
     */
    public AdRequest(CharSequence adBB, Person person) {
        this.adBB = adBB;
        this.person = person;
    }

    public org.apache.avro.Schema getSchema() { return SCHEMA$; }
    // Used by DatumWriter.  Applications should not call.
    public Object get(int field$) {
        switch (field$) {
            case 0: return adBB;
            case 1: return person;
            default: throw new org.apache.avro.AvroRuntimeException("Bad index");
        }
    }
    // Used by DatumReader.  Applications should not call.
    @SuppressWarnings(value="unchecked")
    public void put(int field$, Object value$) {
        switch (field$) {
            case 0: adBB = (CharSequence)value$; break;
            case 1: person = (Person)value$; break;
            default: throw new org.apache.avro.AvroRuntimeException("Bad index");
        }
    }

    /**
     * Gets the value of the 'adBB' field.
     */
    public CharSequence getAdBB() {
        return adBB;
    }

    /**
     * Sets the value of the 'adBB' field.
     * @param value the value to set.
     */
    public void setAdBB(CharSequence value) {
        this.adBB = value;
    }

    /**
     * Gets the value of the 'person' field.
     */
    public Person getPerson() {
        return person;
    }

    /**
     * Sets the value of the 'person' field.
     * @param value the value to set.
     */
    public void setPerson(Person value) {
        this.person = value;
    }

    /** Creates a new AdRequest RecordBuilder */
    public static AdRequest.Builder newBuilder() {
        return new AdRequest.Builder();
    }

    /** Creates a new AdRequest RecordBuilder by copying an existing Builder */
    public static AdRequest.Builder newBuilder(AdRequest.Builder other) {
        return new AdRequest.Builder(other);
    }

    /** Creates a new AdRequest RecordBuilder by copying an existing AdRequest instance */
    public static AdRequest.Builder newBuilder(AdRequest other) {
        return new AdRequest.Builder(other);
    }

    /**
     * RecordBuilder for AdRequest instances.
     */
    public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AdRequest>
            implements org.apache.avro.data.RecordBuilder<AdRequest> {

        private CharSequence adBB;
        private Person person;

        /** Creates a new Builder */
        private Builder() {
            super(AdRequest.SCHEMA$);
        }

        /** Creates a Builder by copying an existing Builder */
        private Builder(AdRequest.Builder other) {
            super(other);
            if (isValidValue(fields()[0], other.adBB)) {
                this.adBB = data().deepCopy(fields()[0].schema(), other.adBB);
                fieldSetFlags()[0] = true;
            }
            if (isValidValue(fields()[1], other.person)) {
                this.person = data().deepCopy(fields()[1].schema(), other.person);
                fieldSetFlags()[1] = true;
            }
        }

        /** Creates a Builder by copying an existing AdRequest instance */
        private Builder(AdRequest other) {
            super(AdRequest.SCHEMA$);
            if (isValidValue(fields()[0], other.adBB)) {
                this.adBB = data().deepCopy(fields()[0].schema(), other.adBB);
                fieldSetFlags()[0] = true;
            }
            if (isValidValue(fields()[1], other.person)) {
                this.person = data().deepCopy(fields()[1].schema(), other.person);
                fieldSetFlags()[1] = true;
            }
        }

        /** Gets the value of the 'adBB' field */
        public CharSequence getAdBB() {
            return adBB;
        }

        /** Sets the value of the 'adBB' field */
        public AdRequest.Builder setAdBB(CharSequence value) {
            validate(fields()[0], value);
            this.adBB = value;
            fieldSetFlags()[0] = true;
            return this;
        }

        /** Checks whether the 'adBB' field has been set */
        public boolean hasAdBB() {
            return fieldSetFlags()[0];
        }

        /** Clears the value of the 'adBB' field */
        public AdRequest.Builder clearAdBB() {
            adBB = null;
            fieldSetFlags()[0] = false;
            return this;
        }

        /** Gets the value of the 'person' field */
        public Person getPerson() {
            return person;
        }

        /** Sets the value of the 'person' field */
        public AdRequest.Builder setPerson(Person value) {
            validate(fields()[1], value);
            this.person = value;
            fieldSetFlags()[1] = true;
            return this;
        }

        /** Checks whether the 'person' field has been set */
        public boolean hasPerson() {
            return fieldSetFlags()[1];
        }

        /** Clears the value of the 'person' field */
        public AdRequest.Builder clearPerson() {
            person = null;
            fieldSetFlags()[1] = false;
            return this;
        }

        @Override
        public AdRequest build() {
            try {
                AdRequest record = new AdRequest();
                record.adBB = fieldSetFlags()[0] ? this.adBB : (CharSequence) defaultValue(fields()[0]);
                record.person = fieldSetFlags()[1] ? this.person : (Person) defaultValue(fields()[1]);
                return record;
            } catch (Exception e) {
                throw new org.apache.avro.AvroRuntimeException(e);
            }
        }
    }
}




Java Source Code List

com.westudio.android.pipe.ApplicationTest.java
com.westudio.android.pipe.MainActivity.java
com.westudio.android.protocol.AdRequest.java
com.westudio.android.protocol.AdResponse.java
com.westudio.android.protocol.AvroAdRequest.java
com.westudio.android.protocol.AvroAdResponse.java
com.westudio.android.protocol.Person.java
com.westudio.android.sdk.exceptions.NetworkError.java
com.westudio.android.sdk.exceptions.ServiceClientError.java
com.westudio.android.sdk.http.ResponseHandler.java
com.westudio.android.sdk.http.ServiceCallback.java
com.westudio.android.sdk.http.ServiceClient.java
com.westudio.android.sdk.loopj.android.http.AsyncHttpClient.java
com.westudio.android.sdk.loopj.android.http.AsyncHttpRequest.java
com.westudio.android.sdk.loopj.android.http.AsyncHttpResponseHandler.java
com.westudio.android.sdk.loopj.android.http.RequestParams.java
com.westudio.android.sdk.loopj.android.http.ResponseHandlerInterface.java
com.westudio.android.sdk.loopj.android.http.SimpleMultipartEntity.java
com.westudio.android.sdk.utils.ALog.java
com.westudio.android.sdk.utils.Serializer.java