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

Ice.Identity 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) 2003-2017 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.6.4
//
// 
//
// Generated from file `Identity.ice'
//
// Warning: do not edit this file.
//
// 
//

package Ice;

/**
 * The identity of an Ice object. In a proxy, an empty {@link Identity#name} denotes a nil
 * proxy. An identity with an empty {@link Identity#name} and a non-empty {@link Identity#category}
 * is illegal. You cannot add a servant with an empty name to the Active Servant Map.
 *
 * @see ServantLocator
 * @see ObjectAdapter#addServantLocator
 *
 **/
public class Identity implements java.lang.Cloneable, java.io.Serializable
{
    /**
     * The name of the Ice object.
     *
     **/
    public String name;

    /**
     * The Ice object category.
     *
     **/
    public String category;

    public Identity()
    {
        name = "";
        category = "";
    }

    public Identity(String name, String category)
    {
        this.name = name;
        this.category = category;
    }

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

        if(_r != null)
        {
            if(name != _r.name)
            {
                if(name == null || _r.name == null || !name.equals(_r.name))
                {
                    return false;
                }
            }
            if(category != _r.category)
            {
                if(category == null || _r.category == null || !category.equals(_r.category))
                {
                    return false;
                }
            }

            return true;
        }

        return false;
    }

    public int
    hashCode()
    {
        int __h = 5381;
        __h = IceInternal.HashUtil.hashAdd(__h, "::Ice::Identity");
        __h = IceInternal.HashUtil.hashAdd(__h, name);
        __h = IceInternal.HashUtil.hashAdd(__h, category);
        return __h;
    }

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

    public void
    __write(IceInternal.BasicStream __os)
    {
        __os.writeString(name);
        __os.writeString(category);
    }

    public void
    __read(IceInternal.BasicStream __is)
    {
        name = __is.readString();
        category = __is.readString();
    }

    static public void
    __write(IceInternal.BasicStream __os, Identity __v)
    {
        if(__v == null)
        {
            __nullMarshalValue.__write(__os);
        }
        else
        {
            __v.__write(__os);
        }
    }

    static public Identity
    __read(IceInternal.BasicStream __is, Identity __v)
    {
        if(__v == null)
        {
             __v = new Identity();
        }
        __v.__read(__is);
        return __v;
    }
    
    private static final Identity __nullMarshalValue = new Identity();

    public static final long serialVersionUID = 8232346505478374757L;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy