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

com.solidfire.element.api.NodeWaitingToJoin 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;

/**
 * NodeWaitingToJoin  
 **/

public class NodeWaitingToJoin implements Serializable {

    public static final long serialVersionUID = 4751353832656225215L;
    @SerializedName("name") private Optional name;
    @SerializedName("version") private String version;
    @SerializedName("nodeID") private Optional nodeID;
    @SerializedName("pendingNodeID") private Optional pendingNodeID;
    @SerializedName("mip") private Optional mip;
    @SerializedName("cip") private Optional cip;
    @SerializedName("sip") private Optional sip;
    @SerializedName("compatible") private Boolean compatible;
    @SerializedName("chassisType") private Optional chassisType;
    @SerializedName("hostname") private Optional hostname;
    @SerializedName("nodeType") private Optional nodeType;
    // empty constructor
    @Since("7.0")
    public NodeWaitingToJoin() {}

    
    // parameterized constructor
    @Since("7.0")
    public NodeWaitingToJoin(
        Optional name,
        String version,
        Optional nodeID,
        Optional pendingNodeID,
        Optional mip,
        Optional cip,
        Optional sip,
        Boolean compatible,
        Optional chassisType,
        Optional hostname,
        Optional nodeType
    )
    {
        this.name = (name == null) ? Optional.empty() : name;
        this.version = version;
        this.nodeID = (nodeID == null) ? Optional.empty() : nodeID;
        this.pendingNodeID = (pendingNodeID == null) ? Optional.empty() : pendingNodeID;
        this.mip = (mip == null) ? Optional.empty() : mip;
        this.cip = (cip == null) ? Optional.empty() : cip;
        this.sip = (sip == null) ? Optional.empty() : sip;
        this.compatible = compatible;
        this.chassisType = (chassisType == null) ? Optional.empty() : chassisType;
        this.hostname = (hostname == null) ? Optional.empty() : hostname;
        this.nodeType = (nodeType == null) ? Optional.empty() : nodeType;
    }

    /** 
     * 
     **/
    public Optional getName() { return this.name; }
   
    public void setName(Optional name) { 
        this.name = (name == null) ? Optional.empty() : name;
    }
    /** 
     * 
     **/
    public String getVersion() { return this.version; }
   
    public void setVersion(String version) { 
        this.version = version;
    }
    /** 
     * 
     **/
    public Optional getNodeID() { return this.nodeID; }
   
    public void setNodeID(Optional nodeID) { 
        this.nodeID = (nodeID == null) ? Optional.empty() : nodeID;
    }
    /** 
     * 
     **/
    public Optional getPendingNodeID() { return this.pendingNodeID; }
   
    public void setPendingNodeID(Optional pendingNodeID) { 
        this.pendingNodeID = (pendingNodeID == null) ? Optional.empty() : pendingNodeID;
    }
    /** 
     * 
     **/
    public Optional getMip() { return this.mip; }
   
    public void setMip(Optional mip) { 
        this.mip = (mip == null) ? Optional.empty() : mip;
    }
    /** 
     * 
     **/
    public Optional getCip() { return this.cip; }
   
    public void setCip(Optional cip) { 
        this.cip = (cip == null) ? Optional.empty() : cip;
    }
    /** 
     * 
     **/
    public Optional getSip() { return this.sip; }
   
    public void setSip(Optional sip) { 
        this.sip = (sip == null) ? Optional.empty() : sip;
    }
    /** 
     * 
     **/
    public Boolean getCompatible() { return this.compatible; }
   
    public void setCompatible(Boolean compatible) { 
        this.compatible = compatible;
    }
    /** 
     * 
     **/
    public Optional getChassisType() { return this.chassisType; }
   
    public void setChassisType(Optional chassisType) { 
        this.chassisType = (chassisType == null) ? Optional.empty() : chassisType;
    }
    /** 
     * 
     **/
    public Optional getHostname() { return this.hostname; }
   
    public void setHostname(Optional hostname) { 
        this.hostname = (hostname == null) ? Optional.empty() : hostname;
    }
    /** 
     * 
     **/
    public Optional getNodeType() { return this.nodeType; }
   
    public void setNodeType(Optional nodeType) { 
        this.nodeType = (nodeType == null) ? Optional.empty() : nodeType;
    }

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

        NodeWaitingToJoin that = (NodeWaitingToJoin) o;

        return 
            Objects.equals(name, that.name) && 
            Objects.equals(version, that.version) && 
            Objects.equals(nodeID, that.nodeID) && 
            Objects.equals(pendingNodeID, that.pendingNodeID) && 
            Objects.equals(mip, that.mip) && 
            Objects.equals(cip, that.cip) && 
            Objects.equals(sip, that.sip) && 
            Objects.equals(compatible, that.compatible) && 
            Objects.equals(chassisType, that.chassisType) && 
            Objects.equals(hostname, that.hostname) && 
            Objects.equals(nodeType, that.nodeType);
    }

    @Override
    public int hashCode() {
        return Objects.hash( name,version,nodeID,pendingNodeID,mip,cip,sip,compatible,chassisType,hostname,nodeType );
    }


    public java.util.Map toMap() {
        java.util.Map map = new HashMap<>();
        map.put("name", name);
        map.put("version", version);
        map.put("nodeID", nodeID);
        map.put("pendingNodeID", pendingNodeID);
        map.put("mip", mip);
        map.put("cip", cip);
        map.put("sip", sip);
        map.put("compatible", compatible);
        map.put("chassisType", chassisType);
        map.put("hostname", hostname);
        map.put("nodeType", nodeType);
        return map;
    }

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

        if(null != name && name.isPresent()){
            sb.append(" name : ").append(gson.toJson(name)).append(",");
        }
        else{
            sb.append(" name : ").append("null").append(",");
        }
        sb.append(" version : ").append(gson.toJson(version)).append(",");
        if(null != nodeID && nodeID.isPresent()){
            sb.append(" nodeID : ").append(gson.toJson(nodeID)).append(",");
        }
        else{
            sb.append(" nodeID : ").append("null").append(",");
        }
        if(null != pendingNodeID && pendingNodeID.isPresent()){
            sb.append(" pendingNodeID : ").append(gson.toJson(pendingNodeID)).append(",");
        }
        else{
            sb.append(" pendingNodeID : ").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 != cip && cip.isPresent()){
            sb.append(" cip : ").append(gson.toJson(cip)).append(",");
        }
        else{
            sb.append(" cip : ").append("null").append(",");
        }
        if(null != sip && sip.isPresent()){
            sb.append(" sip : ").append(gson.toJson(sip)).append(",");
        }
        else{
            sb.append(" sip : ").append("null").append(",");
        }
        sb.append(" compatible : ").append(gson.toJson(compatible)).append(",");
        if(null != chassisType && chassisType.isPresent()){
            sb.append(" chassisType : ").append(gson.toJson(chassisType)).append(",");
        }
        else{
            sb.append(" chassisType : ").append("null").append(",");
        }
        if(null != hostname && hostname.isPresent()){
            sb.append(" hostname : ").append(gson.toJson(hostname)).append(",");
        }
        else{
            sb.append(" hostname : ").append("null").append(",");
        }
        if(null != nodeType && nodeType.isPresent()){
            sb.append(" nodeType : ").append(gson.toJson(nodeType)).append(",");
        }
        else{
            sb.append(" nodeType : ").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 name;
        private String version;
        private Optional nodeID;
        private Optional pendingNodeID;
        private Optional mip;
        private Optional cip;
        private Optional sip;
        private Boolean compatible;
        private Optional chassisType;
        private Optional hostname;
        private Optional nodeType;

        private Builder() { }

        public NodeWaitingToJoin build() {
            return new NodeWaitingToJoin (
                         this.name,
                         this.version,
                         this.nodeID,
                         this.pendingNodeID,
                         this.mip,
                         this.cip,
                         this.sip,
                         this.compatible,
                         this.chassisType,
                         this.hostname,
                         this.nodeType);
        }

        private NodeWaitingToJoin.Builder buildFrom(final NodeWaitingToJoin req) {
            this.name = req.name;
            this.version = req.version;
            this.nodeID = req.nodeID;
            this.pendingNodeID = req.pendingNodeID;
            this.mip = req.mip;
            this.cip = req.cip;
            this.sip = req.sip;
            this.compatible = req.compatible;
            this.chassisType = req.chassisType;
            this.hostname = req.hostname;
            this.nodeType = req.nodeType;

            return this;
        }

        public NodeWaitingToJoin.Builder optionalName(final String name) {
            this.name = (name == null) ? Optional.empty() : Optional.of(name);
            return this;
        }

        public NodeWaitingToJoin.Builder version(final String version) {
            this.version = version;
            return this;
        }

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

        public NodeWaitingToJoin.Builder optionalPendingNodeID(final Long pendingNodeID) {
            this.pendingNodeID = (pendingNodeID == null) ? Optional.empty() : Optional.of(pendingNodeID);
            return this;
        }

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

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

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

        public NodeWaitingToJoin.Builder compatible(final Boolean compatible) {
            this.compatible = compatible;
            return this;
        }

        public NodeWaitingToJoin.Builder optionalChassisType(final String chassisType) {
            this.chassisType = (chassisType == null) ? Optional.empty() : Optional.of(chassisType);
            return this;
        }

        public NodeWaitingToJoin.Builder optionalHostname(final String hostname) {
            this.hostname = (hostname == null) ? Optional.empty() : Optional.of(hostname);
            return this;
        }

        public NodeWaitingToJoin.Builder optionalNodeType(final String nodeType) {
            this.nodeType = (nodeType == null) ? Optional.empty() : Optional.of(nodeType);
            return this;
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy