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

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

    public static Schema getSchema()
    {
        return SCHEMA;
    }

    public static HfsLocation getDefaultInstance()
    {
        return DEFAULT_INSTANCE;
    }

    static final HfsLocation DEFAULT_INSTANCE = new HfsLocation();

    
    // non-private fields
    // see http://developer.android.com/guide/practices/design/performance.html#package_inner
    HfsUuid fileId;

    public HfsLocation()
    {
        
    }

    public HfsLocation(
        HfsUuid fileId
    )
    {
        this.fileId = fileId;
    }

    // getters and setters

    // fileId

    public HfsUuid getFileId()
    {
        return fileId;
    }

    public HfsLocation setFileId(HfsUuid fileId)
    {
        this.fileId = fileId;
        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 HfsLocation newMessage()
        {
            return new HfsLocation();
        }

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

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

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

        public boolean isInitialized(HfsLocation message)
        {
            return 
                message.fileId != null;
        }

        public void mergeFrom(Input input, HfsLocation 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;

                    default:
                        input.handleUnknownField(number, this);
                }   
            }
        }


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

        }

        public String getFieldName(int number)
        {
            switch(number)
            {
                case 1: return "fileId";
                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);
        }
    };
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy