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

com.ursaj.hfs.message.HfsFileInfo 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 HfsFileInfo implements Externalizable, Message
{

    public static Schema getSchema()
    {
        return SCHEMA;
    }

    public static HfsFileInfo getDefaultInstance()
    {
        return DEFAULT_INSTANCE;
    }

    static final HfsFileInfo DEFAULT_INSTANCE = new HfsFileInfo();

    
    // non-private fields
    // see http://developer.android.com/guide/practices/design/performance.html#package_inner
    HfsUuid fileId;
    String fileName;
    String contentType;
    Long size;
    Long validation;

    public HfsFileInfo()
    {
        
    }

    public HfsFileInfo(
        HfsUuid fileId,
        String contentType,
        Long size,
        Long validation
    )
    {
        this.fileId = fileId;
        this.contentType = contentType;
        this.size = size;
        this.validation = validation;
    }

    // getters and setters

    // fileId

    public HfsUuid getFileId()
    {
        return fileId;
    }

    public HfsFileInfo setFileId(HfsUuid fileId)
    {
        this.fileId = fileId;
        return this;
    }

    // fileName

    public String getFileName()
    {
        return fileName;
    }

    public HfsFileInfo setFileName(String fileName)
    {
        this.fileName = fileName;
        return this;
    }

    // contentType

    public String getContentType()
    {
        return contentType;
    }

    public HfsFileInfo setContentType(String contentType)
    {
        this.contentType = contentType;
        return this;
    }

    // size

    public Long getSize()
    {
        return size;
    }

    public HfsFileInfo setSize(Long size)
    {
        this.size = size;
        return this;
    }

    // validation

    public Long getValidation()
    {
        return validation;
    }

    public HfsFileInfo setValidation(Long validation)
    {
        this.validation = validation;
        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 HfsFileInfo newMessage()
        {
            return new HfsFileInfo();
        }

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

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

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

        public boolean isInitialized(HfsFileInfo message)
        {
            return 
                message.fileId != null 
                && message.contentType != null 
                && message.size != null 
                && message.validation != null;
        }

        public void mergeFrom(Input input, HfsFileInfo message) throws IOException
        {
            for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
            {
                switch(number)
                {
                    case 0:
                        return;
                    case 1:
                        message.fileId = input.mergeObject(message.fileId, HfsUuid.getSchema());
                        break;

                    case 2:
                        message.fileName = input.readString();
                        break;
                    case 3:
                        message.contentType = input.readString();
                        break;
                    case 4:
                        message.size = input.readInt64();
                        break;
                    case 5:
                        message.validation = input.readInt64();
                        break;
                    default:
                        input.handleUnknownField(number, this);
                }   
            }
        }


        public void writeTo(Output output, HfsFileInfo message) throws IOException
        {
            if(message.fileId == null)
                throw new UninitializedMessageException(message);
            output.writeObject(1, message.fileId, HfsUuid.getSchema(), false);


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

            if(message.contentType == null)
                throw new UninitializedMessageException(message);
            output.writeString(3, message.contentType, false);

            if(message.size == null)
                throw new UninitializedMessageException(message);
            output.writeInt64(4, message.size, false);

            if(message.validation == null)
                throw new UninitializedMessageException(message);
            output.writeInt64(5, message.validation, false);
        }

        public String getFieldName(int number)
        {
            switch(number)
            {
                case 1: return "fileId";
                case 2: return "fileName";
                case 3: return "contentType";
                case 4: return "size";
                case 5: return "validation";
                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("fileId", 1);
            fieldMap.put("fileName", 2);
            fieldMap.put("contentType", 3);
            fieldMap.put("size", 4);
            fieldMap.put("validation", 5);
        }
    };
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy