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

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

/**
 * NetworkParams  
 **/

public class NetworkParams implements Serializable {

    public static final long serialVersionUID = 7232672011191713417L;
    @SerializedName("Bond10G") private Optional bond10G;
    @SerializedName("Bond1G") private Optional bond1G;
    @SerializedName("eth0") private Optional eth0;
    @SerializedName("eth1") private Optional eth1;
    @SerializedName("eth2") private Optional eth2;
    @SerializedName("eth3") private Optional eth3;
    @SerializedName("lo") private Optional lo;
    // empty constructor
    @Since("7.0")
    public NetworkParams() {}

    
    // parameterized constructor
    @Since("7.0")
    public NetworkParams(
        Optional bond10G,
        Optional bond1G,
        Optional eth0,
        Optional eth1,
        Optional eth2,
        Optional eth3,
        Optional lo
    )
    {
        this.bond10G = (bond10G == null) ? Optional.empty() : bond10G;
        this.bond1G = (bond1G == null) ? Optional.empty() : bond1G;
        this.eth0 = (eth0 == null) ? Optional.empty() : eth0;
        this.eth1 = (eth1 == null) ? Optional.empty() : eth1;
        this.eth2 = (eth2 == null) ? Optional.empty() : eth2;
        this.eth3 = (eth3 == null) ? Optional.empty() : eth3;
        this.lo = (lo == null) ? Optional.empty() : lo;
    }

    /** 
     * 
     **/
    public Optional getBond10G() { return this.bond10G; }
   
    public void setBond10G(Optional bond10G) { 
        this.bond10G = (bond10G == null) ? Optional.empty() : bond10G;
    }
    /** 
     * 
     **/
    public Optional getBond1G() { return this.bond1G; }
   
    public void setBond1G(Optional bond1G) { 
        this.bond1G = (bond1G == null) ? Optional.empty() : bond1G;
    }
    /** 
     * 
     **/
    public Optional getEth0() { return this.eth0; }
   
    public void setEth0(Optional eth0) { 
        this.eth0 = (eth0 == null) ? Optional.empty() : eth0;
    }
    /** 
     * 
     **/
    public Optional getEth1() { return this.eth1; }
   
    public void setEth1(Optional eth1) { 
        this.eth1 = (eth1 == null) ? Optional.empty() : eth1;
    }
    /** 
     * 
     **/
    public Optional getEth2() { return this.eth2; }
   
    public void setEth2(Optional eth2) { 
        this.eth2 = (eth2 == null) ? Optional.empty() : eth2;
    }
    /** 
     * 
     **/
    public Optional getEth3() { return this.eth3; }
   
    public void setEth3(Optional eth3) { 
        this.eth3 = (eth3 == null) ? Optional.empty() : eth3;
    }
    /** 
     * 
     **/
    public Optional getLo() { return this.lo; }
   
    public void setLo(Optional lo) { 
        this.lo = (lo == null) ? Optional.empty() : lo;
    }

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

        NetworkParams that = (NetworkParams) o;

        return 
            Objects.equals(bond10G, that.bond10G) && 
            Objects.equals(bond1G, that.bond1G) && 
            Objects.equals(eth0, that.eth0) && 
            Objects.equals(eth1, that.eth1) && 
            Objects.equals(eth2, that.eth2) && 
            Objects.equals(eth3, that.eth3) && 
            Objects.equals(lo, that.lo);
    }

    @Override
    public int hashCode() {
        return Objects.hash( bond10G,bond1G,eth0,eth1,eth2,eth3,lo );
    }


    public java.util.Map toMap() {
        java.util.Map map = new HashMap<>();
        map.put("bond10G", bond10G);
        map.put("bond1G", bond1G);
        map.put("eth0", eth0);
        map.put("eth1", eth1);
        map.put("eth2", eth2);
        map.put("eth3", eth3);
        map.put("lo", lo);
        return map;
    }

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

        if(null != bond10G && bond10G.isPresent()){
            sb.append(" bond10G : ").append(gson.toJson(bond10G)).append(",");
        }
        else{
            sb.append(" bond10G : ").append("null").append(",");
        }
        if(null != bond1G && bond1G.isPresent()){
            sb.append(" bond1G : ").append(gson.toJson(bond1G)).append(",");
        }
        else{
            sb.append(" bond1G : ").append("null").append(",");
        }
        if(null != eth0 && eth0.isPresent()){
            sb.append(" eth0 : ").append(gson.toJson(eth0)).append(",");
        }
        else{
            sb.append(" eth0 : ").append("null").append(",");
        }
        if(null != eth1 && eth1.isPresent()){
            sb.append(" eth1 : ").append(gson.toJson(eth1)).append(",");
        }
        else{
            sb.append(" eth1 : ").append("null").append(",");
        }
        if(null != eth2 && eth2.isPresent()){
            sb.append(" eth2 : ").append(gson.toJson(eth2)).append(",");
        }
        else{
            sb.append(" eth2 : ").append("null").append(",");
        }
        if(null != eth3 && eth3.isPresent()){
            sb.append(" eth3 : ").append(gson.toJson(eth3)).append(",");
        }
        else{
            sb.append(" eth3 : ").append("null").append(",");
        }
        if(null != lo && lo.isPresent()){
            sb.append(" lo : ").append(gson.toJson(lo)).append(",");
        }
        else{
            sb.append(" lo : ").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 bond10G;
        private Optional bond1G;
        private Optional eth0;
        private Optional eth1;
        private Optional eth2;
        private Optional eth3;
        private Optional lo;

        private Builder() { }

        public NetworkParams build() {
            return new NetworkParams (
                         this.bond10G,
                         this.bond1G,
                         this.eth0,
                         this.eth1,
                         this.eth2,
                         this.eth3,
                         this.lo);
        }

        private NetworkParams.Builder buildFrom(final NetworkParams req) {
            this.bond10G = req.bond10G;
            this.bond1G = req.bond1G;
            this.eth0 = req.eth0;
            this.eth1 = req.eth1;
            this.eth2 = req.eth2;
            this.eth3 = req.eth3;
            this.lo = req.lo;

            return this;
        }

        public NetworkParams.Builder optionalBond10G(final NetworkConfigParams bond10G) {
            this.bond10G = (bond10G == null) ? Optional.empty() : Optional.of(bond10G);
            return this;
        }

        public NetworkParams.Builder optionalBond1G(final NetworkConfigParams bond1G) {
            this.bond1G = (bond1G == null) ? Optional.empty() : Optional.of(bond1G);
            return this;
        }

        public NetworkParams.Builder optionalEth0(final NetworkConfigParams eth0) {
            this.eth0 = (eth0 == null) ? Optional.empty() : Optional.of(eth0);
            return this;
        }

        public NetworkParams.Builder optionalEth1(final NetworkConfigParams eth1) {
            this.eth1 = (eth1 == null) ? Optional.empty() : Optional.of(eth1);
            return this;
        }

        public NetworkParams.Builder optionalEth2(final NetworkConfigParams eth2) {
            this.eth2 = (eth2 == null) ? Optional.empty() : Optional.of(eth2);
            return this;
        }

        public NetworkParams.Builder optionalEth3(final NetworkConfigParams eth3) {
            this.eth3 = (eth3 == null) ? Optional.empty() : Optional.of(eth3);
            return this;
        }

        public NetworkParams.Builder optionalLo(final NetworkConfigParams lo) {
            this.lo = (lo == null) ? Optional.empty() : Optional.of(lo);
            return this;
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy