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

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

/**
 * Network  
 **/

public class Network implements Serializable {

    public static final long serialVersionUID = 8968856628286036613L;
    @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("eth4") private Optional eth4;
    @SerializedName("eth5") private Optional eth5;
    @SerializedName("lo") private Optional lo;
    // empty constructor
    @Since("7.0")
    public Network() {}

    
    // parameterized constructor
    @Since("7.0")
    public Network(
        Optional bond10G,
        Optional bond1G,
        Optional eth0,
        Optional eth1,
        Optional eth2,
        Optional eth3,
        Optional eth4,
        Optional eth5,
        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.eth4 = (eth4 == null) ? Optional.empty() : eth4;
        this.eth5 = (eth5 == null) ? Optional.empty() : eth5;
        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 getEth4() { return this.eth4; }
   
    public void setEth4(Optional eth4) { 
        this.eth4 = (eth4 == null) ? Optional.empty() : eth4;
    }
    /** 
     * 
     **/
    public Optional getEth5() { return this.eth5; }
   
    public void setEth5(Optional eth5) { 
        this.eth5 = (eth5 == null) ? Optional.empty() : eth5;
    }
    /** 
     * 
     **/
    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;

        Network that = (Network) 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(eth4, that.eth4) && 
            Objects.equals(eth5, that.eth5) && 
            Objects.equals(lo, that.lo);
    }

    @Override
    public int hashCode() {
        return Objects.hash( bond10G,bond1G,eth0,eth1,eth2,eth3,eth4,eth5,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("eth4", eth4);
        map.put("eth5", eth5);
        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 != eth4 && eth4.isPresent()){
            sb.append(" eth4 : ").append(gson.toJson(eth4)).append(",");
        }
        else{
            sb.append(" eth4 : ").append("null").append(",");
        }
        if(null != eth5 && eth5.isPresent()){
            sb.append(" eth5 : ").append(gson.toJson(eth5)).append(",");
        }
        else{
            sb.append(" eth5 : ").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 eth4;
        private Optional eth5;
        private Optional lo;

        private Builder() { }

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

        private Network.Builder buildFrom(final Network 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.eth4 = req.eth4;
            this.eth5 = req.eth5;
            this.lo = req.lo;

            return this;
        }

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

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

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

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

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

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

        public Network.Builder optionalEth4(final NetworkConfig eth4) {
            this.eth4 = (eth4 == null) ? Optional.empty() : Optional.of(eth4);
            return this;
        }

        public Network.Builder optionalEth5(final NetworkConfig eth5) {
            this.eth5 = (eth5 == null) ? Optional.empty() : Optional.of(eth5);
            return this;
        }

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

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy