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

com.solidfire.element.api.AddedNode Maven / Gradle / Ivy

The newest version!
/*
 * Copyright © 2014-2016 NetApp, Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * DO NOT EDIT THIS CODE BY HAND! It has been generated with jsvcgen.
 */
package com.solidfire.element.api;

import com.solidfire.gson.Gson;
import com.solidfire.core.client.Attributes;
import com.solidfire.gson.annotations.SerializedName;
import com.solidfire.core.annotation.Since;
import com.solidfire.core.javautil.Optional;
import java.io.Serializable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Objects;

/**
 * AddedNode  
 **/

public class AddedNode implements Serializable {

    public static final long serialVersionUID = 7770473146706377395L;
    @SerializedName("nodeID") private Optional nodeID;
    @SerializedName("pendingNodeID") private Long pendingNodeID;
    @SerializedName("activeNodeKey") private Optional activeNodeKey;
    @SerializedName("assignedNodeID") private Optional assignedNodeID;
    @SerializedName("asyncHandle") private Optional asyncHandle;
    @SerializedName("cip") private Optional cip;
    @SerializedName("mip") private Optional mip;
    @SerializedName("platformInfo") private Optional platformInfo;
    @SerializedName("sip") private Optional sip;
    @SerializedName("softwareVersion") private Optional softwareVersion;
    // empty constructor
    @Since("7.0")
    public AddedNode() {}

    
    // parameterized constructor
    @Since("7.0")
    public AddedNode(
        Optional nodeID,
        Long pendingNodeID,
        Optional activeNodeKey,
        Optional assignedNodeID,
        Optional asyncHandle,
        Optional cip,
        Optional mip,
        Optional platformInfo,
        Optional sip,
        Optional softwareVersion
    )
    {
        this.nodeID = (nodeID == null) ? Optional.empty() : nodeID;
        this.pendingNodeID = pendingNodeID;
        this.activeNodeKey = (activeNodeKey == null) ? Optional.empty() : activeNodeKey;
        this.assignedNodeID = (assignedNodeID == null) ? Optional.empty() : assignedNodeID;
        this.asyncHandle = (asyncHandle == null) ? Optional.empty() : asyncHandle;
        this.cip = (cip == null) ? Optional.empty() : cip;
        this.mip = (mip == null) ? Optional.empty() : mip;
        this.platformInfo = (platformInfo == null) ? Optional.empty() : platformInfo;
        this.sip = (sip == null) ? Optional.empty() : sip;
        this.softwareVersion = (softwareVersion == null) ? Optional.empty() : softwareVersion;
    }

    /** 
     * 
     **/
    public Optional getNodeID() { return this.nodeID; }
   
    public void setNodeID(Optional nodeID) { 
        this.nodeID = (nodeID == null) ? Optional.empty() : nodeID;
    }
    /** 
     * 
     **/
    public Long getPendingNodeID() { return this.pendingNodeID; }
   
    public void setPendingNodeID(Long pendingNodeID) { 
        this.pendingNodeID = pendingNodeID;
    }
    /** 
     * 
     **/
    public Optional getActiveNodeKey() { return this.activeNodeKey; }
   
    public void setActiveNodeKey(Optional activeNodeKey) { 
        this.activeNodeKey = (activeNodeKey == null) ? Optional.empty() : activeNodeKey;
    }
    /** 
     * 
     **/
    public Optional getAssignedNodeID() { return this.assignedNodeID; }
   
    public void setAssignedNodeID(Optional assignedNodeID) { 
        this.assignedNodeID = (assignedNodeID == null) ? Optional.empty() : assignedNodeID;
    }
    /** 
     * 
     **/
    public Optional getAsyncHandle() { return this.asyncHandle; }
   
    public void setAsyncHandle(Optional asyncHandle) { 
        this.asyncHandle = (asyncHandle == null) ? Optional.empty() : asyncHandle;
    }
    /** 
     * 
     **/
    public Optional getCip() { return this.cip; }
   
    public void setCip(Optional cip) { 
        this.cip = (cip == null) ? Optional.empty() : cip;
    }
    /** 
     * 
     **/
    public Optional getMip() { return this.mip; }
   
    public void setMip(Optional mip) { 
        this.mip = (mip == null) ? Optional.empty() : mip;
    }
    /** 
     * 
     **/
    public Optional getPlatformInfo() { return this.platformInfo; }
   
    public void setPlatformInfo(Optional platformInfo) { 
        this.platformInfo = (platformInfo == null) ? Optional.empty() : platformInfo;
    }
    /** 
     * 
     **/
    public Optional getSip() { return this.sip; }
   
    public void setSip(Optional sip) { 
        this.sip = (sip == null) ? Optional.empty() : sip;
    }
    /** 
     * 
     **/
    public Optional getSoftwareVersion() { return this.softwareVersion; }
   
    public void setSoftwareVersion(Optional softwareVersion) { 
        this.softwareVersion = (softwareVersion == null) ? Optional.empty() : softwareVersion;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AddedNode that = (AddedNode) o;

        return 
            Objects.equals(nodeID, that.nodeID) && 
            Objects.equals(pendingNodeID, that.pendingNodeID) && 
            Objects.equals(activeNodeKey, that.activeNodeKey) && 
            Objects.equals(assignedNodeID, that.assignedNodeID) && 
            Objects.equals(asyncHandle, that.asyncHandle) && 
            Objects.equals(cip, that.cip) && 
            Objects.equals(mip, that.mip) && 
            Objects.equals(platformInfo, that.platformInfo) && 
            Objects.equals(sip, that.sip) && 
            Objects.equals(softwareVersion, that.softwareVersion);
    }

    @Override
    public int hashCode() {
        return Objects.hash( nodeID,pendingNodeID,activeNodeKey,assignedNodeID,asyncHandle,cip,mip,platformInfo,sip,softwareVersion );
    }


    public java.util.Map toMap() {
        java.util.Map map = new HashMap<>();
        map.put("nodeID", nodeID);
        map.put("pendingNodeID", pendingNodeID);
        map.put("activeNodeKey", activeNodeKey);
        map.put("assignedNodeID", assignedNodeID);
        map.put("asyncHandle", asyncHandle);
        map.put("cip", cip);
        map.put("mip", mip);
        map.put("platformInfo", platformInfo);
        map.put("sip", sip);
        map.put("softwareVersion", softwareVersion);
        return map;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        Gson gson = new Gson();
        sb.append( "{ " );

        if(null != nodeID && nodeID.isPresent()){
            sb.append(" nodeID : ").append(gson.toJson(nodeID)).append(",");
        }
        else{
            sb.append(" nodeID : ").append("null").append(",");
        }
        sb.append(" pendingNodeID : ").append(gson.toJson(pendingNodeID)).append(",");
        if(null != activeNodeKey && activeNodeKey.isPresent()){
            sb.append(" activeNodeKey : ").append(gson.toJson(activeNodeKey)).append(",");
        }
        else{
            sb.append(" activeNodeKey : ").append("null").append(",");
        }
        if(null != assignedNodeID && assignedNodeID.isPresent()){
            sb.append(" assignedNodeID : ").append(gson.toJson(assignedNodeID)).append(",");
        }
        else{
            sb.append(" assignedNodeID : ").append("null").append(",");
        }
        if(null != asyncHandle && asyncHandle.isPresent()){
            sb.append(" asyncHandle : ").append(gson.toJson(asyncHandle)).append(",");
        }
        else{
            sb.append(" asyncHandle : ").append("null").append(",");
        }
        if(null != cip && cip.isPresent()){
            sb.append(" cip : ").append(gson.toJson(cip)).append(",");
        }
        else{
            sb.append(" cip : ").append("null").append(",");
        }
        if(null != mip && mip.isPresent()){
            sb.append(" mip : ").append(gson.toJson(mip)).append(",");
        }
        else{
            sb.append(" mip : ").append("null").append(",");
        }
        if(null != platformInfo && platformInfo.isPresent()){
            sb.append(" platformInfo : ").append(gson.toJson(platformInfo)).append(",");
        }
        else{
            sb.append(" platformInfo : ").append("null").append(",");
        }
        if(null != sip && sip.isPresent()){
            sb.append(" sip : ").append(gson.toJson(sip)).append(",");
        }
        else{
            sb.append(" sip : ").append("null").append(",");
        }
        if(null != softwareVersion && softwareVersion.isPresent()){
            sb.append(" softwareVersion : ").append(gson.toJson(softwareVersion)).append(",");
        }
        else{
            sb.append(" softwareVersion : ").append("null").append(",");
        }
        sb.append( " }" );

        if(sb.lastIndexOf(", }") != -1)
            sb.deleteCharAt(sb.lastIndexOf(", }"));

        return sb.toString();
    }

    public static Builder builder() {
        return new Builder();
    }

    public final Builder asBuilder() {
        return new Builder().buildFrom(this);
    }

    public static class Builder {
        private Optional nodeID;
        private Long pendingNodeID;
        private Optional activeNodeKey;
        private Optional assignedNodeID;
        private Optional asyncHandle;
        private Optional cip;
        private Optional mip;
        private Optional platformInfo;
        private Optional sip;
        private Optional softwareVersion;

        private Builder() { }

        public AddedNode build() {
            return new AddedNode (
                         this.nodeID,
                         this.pendingNodeID,
                         this.activeNodeKey,
                         this.assignedNodeID,
                         this.asyncHandle,
                         this.cip,
                         this.mip,
                         this.platformInfo,
                         this.sip,
                         this.softwareVersion);
        }

        private AddedNode.Builder buildFrom(final AddedNode req) {
            this.nodeID = req.nodeID;
            this.pendingNodeID = req.pendingNodeID;
            this.activeNodeKey = req.activeNodeKey;
            this.assignedNodeID = req.assignedNodeID;
            this.asyncHandle = req.asyncHandle;
            this.cip = req.cip;
            this.mip = req.mip;
            this.platformInfo = req.platformInfo;
            this.sip = req.sip;
            this.softwareVersion = req.softwareVersion;

            return this;
        }

        public AddedNode.Builder optionalNodeID(final Long nodeID) {
            this.nodeID = (nodeID == null) ? Optional.empty() : Optional.of(nodeID);
            return this;
        }

        public AddedNode.Builder pendingNodeID(final Long pendingNodeID) {
            this.pendingNodeID = pendingNodeID;
            return this;
        }

        public AddedNode.Builder optionalActiveNodeKey(final String activeNodeKey) {
            this.activeNodeKey = (activeNodeKey == null) ? Optional.empty() : Optional.of(activeNodeKey);
            return this;
        }

        public AddedNode.Builder optionalAssignedNodeID(final Long assignedNodeID) {
            this.assignedNodeID = (assignedNodeID == null) ? Optional.empty() : Optional.of(assignedNodeID);
            return this;
        }

        public AddedNode.Builder optionalAsyncHandle(final Long asyncHandle) {
            this.asyncHandle = (asyncHandle == null) ? Optional.empty() : Optional.of(asyncHandle);
            return this;
        }

        public AddedNode.Builder optionalCip(final String cip) {
            this.cip = (cip == null) ? Optional.empty() : Optional.of(cip);
            return this;
        }

        public AddedNode.Builder optionalMip(final String mip) {
            this.mip = (mip == null) ? Optional.empty() : Optional.of(mip);
            return this;
        }

        public AddedNode.Builder optionalPlatformInfo(final Platform platformInfo) {
            this.platformInfo = (platformInfo == null) ? Optional.empty() : Optional.of(platformInfo);
            return this;
        }

        public AddedNode.Builder optionalSip(final String sip) {
            this.sip = (sip == null) ? Optional.empty() : Optional.of(sip);
            return this;
        }

        public AddedNode.Builder optionalSoftwareVersion(final String softwareVersion) {
            this.softwareVersion = (softwareVersion == null) ? Optional.empty() : Optional.of(softwareVersion);
            return this;
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy