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

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

/**
 * ClusterConfig  
 * Cluster Config object returns information the node uses to communicate with the cluster.
 **/

public class ClusterConfig implements Serializable {

    public static final long serialVersionUID = 3884387958155246889L;
    @SerializedName("cipi") private Optional cipi;
    @SerializedName("cluster") private Optional cluster;
    @SerializedName("ensemble") private Optional ensemble;
    @SerializedName("mipi") private Optional mipi;
    @SerializedName("name") private Optional name;
    @SerializedName("nodeID") private Optional nodeID;
    @SerializedName("pendingNodeID") private Optional pendingNodeID;
    @SerializedName("role") private Optional role;
    @SerializedName("sipi") private Optional sipi;
    @SerializedName("state") private Optional state;
    @SerializedName("encryptionCapable") private Optional encryptionCapable;
    @SerializedName("hasLocalAdmin") private Optional hasLocalAdmin;
    @SerializedName("version") private Optional version;
    // empty constructor
    @Since("7.0")
    public ClusterConfig() {}

    
    // parameterized constructor
    @Since("7.0")
    public ClusterConfig(
        Optional cipi,
        Optional cluster,
        Optional ensemble,
        Optional mipi,
        Optional name,
        Optional nodeID,
        Optional pendingNodeID,
        Optional role,
        Optional sipi,
        Optional state,
        Optional encryptionCapable,
        Optional hasLocalAdmin,
        Optional version
    )
    {
        this.cipi = (cipi == null) ? Optional.empty() : cipi;
        this.cluster = (cluster == null) ? Optional.empty() : cluster;
        this.ensemble = (ensemble == null) ? Optional.empty() : ensemble;
        this.mipi = (mipi == null) ? Optional.empty() : mipi;
        this.name = (name == null) ? Optional.empty() : name;
        this.nodeID = (nodeID == null) ? Optional.empty() : nodeID;
        this.pendingNodeID = (pendingNodeID == null) ? Optional.empty() : pendingNodeID;
        this.role = (role == null) ? Optional.empty() : role;
        this.sipi = (sipi == null) ? Optional.empty() : sipi;
        this.state = (state == null) ? Optional.empty() : state;
        this.encryptionCapable = (encryptionCapable == null) ? Optional.empty() : encryptionCapable;
        this.hasLocalAdmin = (hasLocalAdmin == null) ? Optional.empty() : hasLocalAdmin;
        this.version = (version == null) ? Optional.empty() : version;
    }

    /** 
     * Network interface used for cluster communication.
     **/
    public Optional getCipi() { return this.cipi; }
   
    public void setCipi(Optional cipi) { 
        this.cipi = (cipi == null) ? Optional.empty() : cipi;
    }
    /** 
     * Unique cluster name.
     **/
    public Optional getCluster() { return this.cluster; }
   
    public void setCluster(Optional cluster) { 
        this.cluster = (cluster == null) ? Optional.empty() : cluster;
    }
    /** 
     * Nodes that are participating in the cluster.
     **/
    public Optional getEnsemble() { return this.ensemble; }
   
    public void setEnsemble(Optional ensemble) { 
        this.ensemble = (ensemble == null) ? Optional.empty() : ensemble;
    }
    /** 
     * Network interface used for node management.
     **/
    public Optional getMipi() { return this.mipi; }
   
    public void setMipi(Optional mipi) { 
        this.mipi = (mipi == null) ? Optional.empty() : mipi;
    }
    /** 
     * Unique cluster name.
     **/
    public Optional getName() { return this.name; }
   
    public void setName(Optional name) { 
        this.name = (name == null) ? Optional.empty() : name;
    }
    /** 
     * 
     **/
    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;
    }
    /** 
     * Identifies the role of the node
     **/
    public Optional getRole() { return this.role; }
   
    public void setRole(Optional role) { 
        this.role = (role == null) ? Optional.empty() : role;
    }
    /** 
     * Network interface used for storage.
     **/
    public Optional getSipi() { return this.sipi; }
   
    public void setSipi(Optional sipi) { 
        this.sipi = (sipi == null) ? Optional.empty() : sipi;
    }
    /** 
     * 
     **/
    public Optional getState() { return this.state; }
   
    public void setState(Optional state) { 
        this.state = (state == null) ? Optional.empty() : state;
    }
    /** 
     * 
     **/
    public Optional getEncryptionCapable() { return this.encryptionCapable; }
   
    public void setEncryptionCapable(Optional encryptionCapable) { 
        this.encryptionCapable = (encryptionCapable == null) ? Optional.empty() : encryptionCapable;
    }
    /** 
     * 
     **/
    public Optional getHasLocalAdmin() { return this.hasLocalAdmin; }
   
    public void setHasLocalAdmin(Optional hasLocalAdmin) { 
        this.hasLocalAdmin = (hasLocalAdmin == null) ? Optional.empty() : hasLocalAdmin;
    }
    /** 
     * 
     **/
    public Optional getVersion() { return this.version; }
   
    public void setVersion(Optional version) { 
        this.version = (version == null) ? Optional.empty() : version;
    }

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

        ClusterConfig that = (ClusterConfig) o;

        return 
            Objects.equals(cipi, that.cipi) && 
            Objects.equals(cluster, that.cluster) && 
            Objects.equals(ensemble, that.ensemble) && 
            Objects.equals(mipi, that.mipi) && 
            Objects.equals(name, that.name) && 
            Objects.equals(nodeID, that.nodeID) && 
            Objects.equals(pendingNodeID, that.pendingNodeID) && 
            Objects.equals(role, that.role) && 
            Objects.equals(sipi, that.sipi) && 
            Objects.equals(state, that.state) && 
            Objects.equals(encryptionCapable, that.encryptionCapable) && 
            Objects.equals(hasLocalAdmin, that.hasLocalAdmin) && 
            Objects.equals(version, that.version);
    }

    @Override
    public int hashCode() {
        return Objects.hash( cipi,cluster,ensemble,mipi,name,nodeID,pendingNodeID,role,sipi,state,encryptionCapable,hasLocalAdmin,version );
    }


    public java.util.Map toMap() {
        java.util.Map map = new HashMap<>();
        map.put("cipi", cipi);
        map.put("cluster", cluster);
        map.put("ensemble", ensemble);
        map.put("mipi", mipi);
        map.put("name", name);
        map.put("nodeID", nodeID);
        map.put("pendingNodeID", pendingNodeID);
        map.put("role", role);
        map.put("sipi", sipi);
        map.put("state", state);
        map.put("encryptionCapable", encryptionCapable);
        map.put("hasLocalAdmin", hasLocalAdmin);
        map.put("version", version);
        return map;
    }

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

        if(null != cipi && cipi.isPresent()){
            sb.append(" cipi : ").append(gson.toJson(cipi)).append(",");
        }
        else{
            sb.append(" cipi : ").append("null").append(",");
        }
        if(null != cluster && cluster.isPresent()){
            sb.append(" cluster : ").append(gson.toJson(cluster)).append(",");
        }
        else{
            sb.append(" cluster : ").append("null").append(",");
        }
        if(null != ensemble && ensemble.isPresent()){
            sb.append(" ensemble : ").append(gson.toJson(ensemble)).append(",");
        }
        else{
            sb.append(" ensemble : ").append("null").append(",");
        }
        if(null != mipi && mipi.isPresent()){
            sb.append(" mipi : ").append(gson.toJson(mipi)).append(",");
        }
        else{
            sb.append(" mipi : ").append("null").append(",");
        }
        if(null != name && name.isPresent()){
            sb.append(" name : ").append(gson.toJson(name)).append(",");
        }
        else{
            sb.append(" name : ").append("null").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 != role && role.isPresent()){
            sb.append(" role : ").append(gson.toJson(role)).append(",");
        }
        else{
            sb.append(" role : ").append("null").append(",");
        }
        if(null != sipi && sipi.isPresent()){
            sb.append(" sipi : ").append(gson.toJson(sipi)).append(",");
        }
        else{
            sb.append(" sipi : ").append("null").append(",");
        }
        if(null != state && state.isPresent()){
            sb.append(" state : ").append(gson.toJson(state)).append(",");
        }
        else{
            sb.append(" state : ").append("null").append(",");
        }
        if(null != encryptionCapable && encryptionCapable.isPresent()){
            sb.append(" encryptionCapable : ").append(gson.toJson(encryptionCapable)).append(",");
        }
        else{
            sb.append(" encryptionCapable : ").append("null").append(",");
        }
        if(null != hasLocalAdmin && hasLocalAdmin.isPresent()){
            sb.append(" hasLocalAdmin : ").append(gson.toJson(hasLocalAdmin)).append(",");
        }
        else{
            sb.append(" hasLocalAdmin : ").append("null").append(",");
        }
        if(null != version && version.isPresent()){
            sb.append(" version : ").append(gson.toJson(version)).append(",");
        }
        else{
            sb.append(" version : ").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 cipi;
        private Optional cluster;
        private Optional ensemble;
        private Optional mipi;
        private Optional name;
        private Optional nodeID;
        private Optional pendingNodeID;
        private Optional role;
        private Optional sipi;
        private Optional state;
        private Optional encryptionCapable;
        private Optional hasLocalAdmin;
        private Optional version;

        private Builder() { }

        public ClusterConfig build() {
            return new ClusterConfig (
                         this.cipi,
                         this.cluster,
                         this.ensemble,
                         this.mipi,
                         this.name,
                         this.nodeID,
                         this.pendingNodeID,
                         this.role,
                         this.sipi,
                         this.state,
                         this.encryptionCapable,
                         this.hasLocalAdmin,
                         this.version);
        }

        private ClusterConfig.Builder buildFrom(final ClusterConfig req) {
            this.cipi = req.cipi;
            this.cluster = req.cluster;
            this.ensemble = req.ensemble;
            this.mipi = req.mipi;
            this.name = req.name;
            this.nodeID = req.nodeID;
            this.pendingNodeID = req.pendingNodeID;
            this.role = req.role;
            this.sipi = req.sipi;
            this.state = req.state;
            this.encryptionCapable = req.encryptionCapable;
            this.hasLocalAdmin = req.hasLocalAdmin;
            this.version = req.version;

            return this;
        }

        public ClusterConfig.Builder optionalCipi(final String cipi) {
            this.cipi = (cipi == null) ? Optional.empty() : Optional.of(cipi);
            return this;
        }

        public ClusterConfig.Builder optionalCluster(final String cluster) {
            this.cluster = (cluster == null) ? Optional.empty() : Optional.of(cluster);
            return this;
        }

        public ClusterConfig.Builder optionalEnsemble(final String[] ensemble) {
            this.ensemble = (ensemble == null) ? Optional.empty() : Optional.of(ensemble);
            return this;
        }

        public ClusterConfig.Builder optionalMipi(final String mipi) {
            this.mipi = (mipi == null) ? Optional.empty() : Optional.of(mipi);
            return this;
        }

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

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

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

        public ClusterConfig.Builder optionalRole(final String role) {
            this.role = (role == null) ? Optional.empty() : Optional.of(role);
            return this;
        }

        public ClusterConfig.Builder optionalSipi(final String sipi) {
            this.sipi = (sipi == null) ? Optional.empty() : Optional.of(sipi);
            return this;
        }

        public ClusterConfig.Builder optionalState(final String state) {
            this.state = (state == null) ? Optional.empty() : Optional.of(state);
            return this;
        }

        public ClusterConfig.Builder optionalEncryptionCapable(final Boolean encryptionCapable) {
            this.encryptionCapable = (encryptionCapable == null) ? Optional.empty() : Optional.of(encryptionCapable);
            return this;
        }

        public ClusterConfig.Builder optionalHasLocalAdmin(final Boolean hasLocalAdmin) {
            this.hasLocalAdmin = (hasLocalAdmin == null) ? Optional.empty() : Optional.of(hasLocalAdmin);
            return this;
        }

        public ClusterConfig.Builder optionalVersion(final String version) {
            this.version = (version == null) ? Optional.empty() : Optional.of(version);
            return this;
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy