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

Ice.ProtocolVersion Maven / Gradle / Ivy

Go to download

Ice is a comprehensive RPC framework that helps you build distributed applications with minimal effort using familiar object-oriented idioms

There is a newer version: 3.7.10
Show newest version
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
//
// Ice version 3.7.3
//
// 
//
// Generated from file `Version.ice'
//
// Warning: do not edit this file.
//
// 
//

package Ice;

/**
 * A version structure for the protocol version.
 *
 **/
public class ProtocolVersion implements java.lang.Cloneable,
                                        java.io.Serializable
{
    public byte major;

    public byte minor;

    public ProtocolVersion()
    {
    }

    public ProtocolVersion(byte major, byte minor)
    {
        this.major = major;
        this.minor = minor;
    }

    public boolean
    equals(java.lang.Object rhs)
    {
        if(this == rhs)
        {
            return true;
        }
        ProtocolVersion r = null;
        if(rhs instanceof ProtocolVersion)
        {
            r = (ProtocolVersion)rhs;
        }

        if(r != null)
        {
            if(this.major != r.major)
            {
                return false;
            }
            if(this.minor != r.minor)
            {
                return false;
            }

            return true;
        }

        return false;
    }

    public int
    hashCode()
    {
        int h_ = 5381;
        h_ = IceInternal.HashUtil.hashAdd(h_, "::Ice::ProtocolVersion");
        h_ = IceInternal.HashUtil.hashAdd(h_, major);
        h_ = IceInternal.HashUtil.hashAdd(h_, minor);
        return h_;
    }

    public ProtocolVersion
    clone()
    {
        ProtocolVersion c = null;
        try
        {
            c = (ProtocolVersion)super.clone();
        }
        catch(CloneNotSupportedException ex)
        {
            assert false; // impossible
        }
        return c;
    }

    public void
    ice_writeMembers(OutputStream ostr)
    {
        ostr.writeByte(this.major);
        ostr.writeByte(this.minor);
    }

    public void
    ice_readMembers(InputStream istr)
    {
        this.major = istr.readByte();
        this.minor = istr.readByte();
    }

    static public void
    ice_write(OutputStream ostr, ProtocolVersion v)
    {
        if(v == null)
        {
            _nullMarshalValue.ice_writeMembers(ostr);
        }
        else
        {
            v.ice_writeMembers(ostr);
        }
    }

    static public ProtocolVersion
    ice_read(InputStream istr)
    {
        ProtocolVersion v = new ProtocolVersion();
        v.ice_readMembers(istr);
        return v;
    }

    private static final ProtocolVersion _nullMarshalValue = new ProtocolVersion();

    public static final long serialVersionUID = -5263487476542015228L;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy