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

com.ursaj.hfs.message.HfsUploadRequest Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version
// Generated by http://code.google.com/p/protostuff/ ... DO NOT EDIT!
// Generated from messages.proto

package com.ursaj.hfs.message;

import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;

import com.dyuproject.protostuff.GraphIOUtil;
import com.dyuproject.protostuff.Input;
import com.dyuproject.protostuff.Message;
import com.dyuproject.protostuff.Output;
import com.dyuproject.protostuff.Schema;
import com.dyuproject.protostuff.UninitializedMessageException;

public final class HfsUploadRequest implements Externalizable, Message
{

    public static Schema getSchema()
    {
        return SCHEMA;
    }

    public static HfsUploadRequest getDefaultInstance()
    {
        return DEFAULT_INSTANCE;
    }

    static final HfsUploadRequest DEFAULT_INSTANCE = new HfsUploadRequest();

    static final long DEFAULT_MAX_UPLOAD_SIZE = 10485760l;
    static final long DEFAULT_MAX_FILE_SIZE = 10485760l;
    static final int DEFAULT_MAX_FILES_COUNT = 10;
    
    // non-private fields
    // see http://developer.android.com/guide/practices/design/performance.html#package_inner
    Long expiration;
    String format;
    long maxUploadSize = DEFAULT_MAX_UPLOAD_SIZE;
    long maxFileSize = DEFAULT_MAX_FILE_SIZE;
    int maxFilesCount = DEFAULT_MAX_FILES_COUNT;

    public HfsUploadRequest()
    {
        
    }

    public HfsUploadRequest(
        Long expiration
    )
    {
        this.expiration = expiration;
    }

    // getters and setters

    // expiration

    public Long getExpiration()
    {
        return expiration;
    }

    public HfsUploadRequest setExpiration(Long expiration)
    {
        this.expiration = expiration;
        return this;
    }

    // format

    public String getFormat()
    {
        return format;
    }

    public HfsUploadRequest setFormat(String format)
    {
        this.format = format;
        return this;
    }

    // maxUploadSize

    public long getMaxUploadSize()
    {
        return maxUploadSize;
    }

    public HfsUploadRequest setMaxUploadSize(long maxUploadSize)
    {
        this.maxUploadSize = maxUploadSize;
        return this;
    }

    // maxFileSize

    public long getMaxFileSize()
    {
        return maxFileSize;
    }

    public HfsUploadRequest setMaxFileSize(long maxFileSize)
    {
        this.maxFileSize = maxFileSize;
        return this;
    }

    // maxFilesCount

    public int getMaxFilesCount()
    {
        return maxFilesCount;
    }

    public HfsUploadRequest setMaxFilesCount(int maxFilesCount)
    {
        this.maxFilesCount = maxFilesCount;
        return this;
    }

    // java serialization

    public void readExternal(ObjectInput in) throws IOException
    {
        GraphIOUtil.mergeDelimitedFrom(in, this, SCHEMA);
    }

    public void writeExternal(ObjectOutput out) throws IOException
    {
        GraphIOUtil.writeDelimitedTo(out, this, SCHEMA);
    }

    // message method

    public Schema cachedSchema()
    {
        return SCHEMA;
    }

    static final Schema SCHEMA = new Schema()
    {
        // schema methods

        public HfsUploadRequest newMessage()
        {
            return new HfsUploadRequest();
        }

        public Class typeClass()
        {
            return HfsUploadRequest.class;
        }

        public String messageName()
        {
            return HfsUploadRequest.class.getSimpleName();
        }

        public String messageFullName()
        {
            return HfsUploadRequest.class.getName();
        }

        public boolean isInitialized(HfsUploadRequest message)
        {
            return 
                message.expiration != null;
        }

        public void mergeFrom(Input input, HfsUploadRequest message) throws IOException
        {
            for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
            {
                switch(number)
                {
                    case 0:
                        return;
                    case 1:
                        message.expiration = input.readInt64();
                        break;
                    case 2:
                        message.format = input.readString();
                        break;
                    case 3:
                        message.maxUploadSize = input.readInt64();
                        break;
                    case 4:
                        message.maxFileSize = input.readInt64();
                        break;
                    case 5:
                        message.maxFilesCount = input.readInt32();
                        break;
                    default:
                        input.handleUnknownField(number, this);
                }   
            }
        }


        public void writeTo(Output output, HfsUploadRequest message) throws IOException
        {
            if(message.expiration == null)
                throw new UninitializedMessageException(message);
            output.writeInt64(1, message.expiration, false);

            if(message.format != null)
                output.writeString(2, message.format, false);

            if(message.maxUploadSize != DEFAULT_MAX_UPLOAD_SIZE)
                output.writeInt64(3, message.maxUploadSize, false);

            if(message.maxFileSize != DEFAULT_MAX_FILE_SIZE)
                output.writeInt64(4, message.maxFileSize, false);

            if(message.maxFilesCount != DEFAULT_MAX_FILES_COUNT)
                output.writeInt32(5, message.maxFilesCount, false);
        }

        public String getFieldName(int number)
        {
            switch(number)
            {
                case 1: return "expiration";
                case 2: return "format";
                case 3: return "maxUploadSize";
                case 4: return "maxFileSize";
                case 5: return "maxFilesCount";
                default: return null;
            }
        }

        public int getFieldNumber(String name)
        {
            final Integer number = fieldMap.get(name);
            return number == null ? 0 : number.intValue();
        }

        final java.util.HashMap fieldMap = new java.util.HashMap();
        {
            fieldMap.put("expiration", 1);
            fieldMap.put("format", 2);
            fieldMap.put("maxUploadSize", 3);
            fieldMap.put("maxFileSize", 4);
            fieldMap.put("maxFilesCount", 5);
        }
    };
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy