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

IceGrid.ServiceInstanceDescriptor Maven / Gradle / Ivy

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 `Descriptor.ice'
//
// Warning: do not edit this file.
//
// 
//

package IceGrid;

/**
 * A service template instance descriptor.
 *
 **/
public class ServiceInstanceDescriptor implements java.lang.Cloneable,
                                                  java.io.Serializable
{
    /**
     * The template used by this instance.
     *
     **/
    public String template;

    /**
     * The template parameter values.
     *
     **/
    public java.util.Map parameterValues;

    /**
     * The service definition if the instance isn't a template
     * instance (i.e.: if the template attribute is empty).
     *
     **/
    public ServiceDescriptor descriptor;

    /**
     * The property set.
     *
     **/
    public PropertySetDescriptor propertySet;

    public ServiceInstanceDescriptor()
    {
        this.template = "";
        this.propertySet = new PropertySetDescriptor();
    }

    public ServiceInstanceDescriptor(String template, java.util.Map parameterValues, ServiceDescriptor descriptor, PropertySetDescriptor propertySet)
    {
        this.template = template;
        this.parameterValues = parameterValues;
        this.descriptor = descriptor;
        this.propertySet = propertySet;
    }

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

        if(r != null)
        {
            if(this.template != r.template)
            {
                if(this.template == null || r.template == null || !this.template.equals(r.template))
                {
                    return false;
                }
            }
            if(this.parameterValues != r.parameterValues)
            {
                if(this.parameterValues == null || r.parameterValues == null || !this.parameterValues.equals(r.parameterValues))
                {
                    return false;
                }
            }
            if(this.descriptor != r.descriptor)
            {
                if(this.descriptor == null || r.descriptor == null || !this.descriptor.equals(r.descriptor))
                {
                    return false;
                }
            }
            if(this.propertySet != r.propertySet)
            {
                if(this.propertySet == null || r.propertySet == null || !this.propertySet.equals(r.propertySet))
                {
                    return false;
                }
            }

            return true;
        }

        return false;
    }

    public int
    hashCode()
    {
        int h_ = 5381;
        h_ = IceInternal.HashUtil.hashAdd(h_, "::IceGrid::ServiceInstanceDescriptor");
        h_ = IceInternal.HashUtil.hashAdd(h_, template);
        h_ = IceInternal.HashUtil.hashAdd(h_, parameterValues);
        h_ = IceInternal.HashUtil.hashAdd(h_, descriptor);
        h_ = IceInternal.HashUtil.hashAdd(h_, propertySet);
        return h_;
    }

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

    public void
    ice_writeMembers(Ice.OutputStream ostr)
    {
        ostr.writeString(this.template);
        StringStringDictHelper.write(ostr, this.parameterValues);
        ostr.writeValue(this.descriptor);
        PropertySetDescriptor.ice_write(ostr, this.propertySet);
    }

    private class Patcher implements Ice.ReadValueCallback
    {
        public void
        valueReady(Ice.Object v)
        {
            if(v == null || v instanceof ServiceDescriptor)
            {
                descriptor = (ServiceDescriptor)v;
            }
            else
            {
                IceInternal.Ex.throwUOE(type(), v);
            }
        }

        public String
        type()
        {
            return "::IceGrid::ServiceDescriptor";
        }
    }

    public void
    ice_readMembers(Ice.InputStream istr)
    {
        this.template = istr.readString();
        this.parameterValues = StringStringDictHelper.read(istr);
        istr.readValue(new Patcher());
        this.propertySet = PropertySetDescriptor.ice_read(istr);
    }

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

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

    private static final ServiceInstanceDescriptor _nullMarshalValue = new ServiceInstanceDescriptor();

    public static final long serialVersionUID = 7680765263579554924L;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy