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

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

/**
 * PhysicalAdapter  
 **/

public class PhysicalAdapter implements Serializable {

    public static final long serialVersionUID = -950225984887038109L;
    @SerializedName("address") private Optional address;
    @SerializedName("macAddress") private Optional macAddress;
    @SerializedName("macAddressPermanent") private Optional macAddressPermanent;
    @SerializedName("mtu") private Optional mtu;
    @SerializedName("netmask") private Optional netmask;
    @SerializedName("network") private Optional network;
    @SerializedName("upAndRunning") private Optional upAndRunning;
    // empty constructor
    @Since("7.0")
    public PhysicalAdapter() {}

    
    // parameterized constructor
    @Since("7.0")
    public PhysicalAdapter(
        Optional address,
        Optional macAddress,
        Optional macAddressPermanent,
        Optional mtu,
        Optional netmask,
        Optional network,
        Optional upAndRunning
    )
    {
        this.address = (address == null) ? Optional.empty() : address;
        this.macAddress = (macAddress == null) ? Optional.empty() : macAddress;
        this.macAddressPermanent = (macAddressPermanent == null) ? Optional.empty() : macAddressPermanent;
        this.mtu = (mtu == null) ? Optional.empty() : mtu;
        this.netmask = (netmask == null) ? Optional.empty() : netmask;
        this.network = (network == null) ? Optional.empty() : network;
        this.upAndRunning = (upAndRunning == null) ? Optional.empty() : upAndRunning;
    }

    /** 
     * 
     **/
    public Optional getAddress() { return this.address; }
   
    public void setAddress(Optional address) { 
        this.address = (address == null) ? Optional.empty() : address;
    }
    /** 
     * 
     **/
    public Optional getMacAddress() { return this.macAddress; }
   
    public void setMacAddress(Optional macAddress) { 
        this.macAddress = (macAddress == null) ? Optional.empty() : macAddress;
    }
    /** 
     * 
     **/
    public Optional getMacAddressPermanent() { return this.macAddressPermanent; }
   
    public void setMacAddressPermanent(Optional macAddressPermanent) { 
        this.macAddressPermanent = (macAddressPermanent == null) ? Optional.empty() : macAddressPermanent;
    }
    /** 
     * 
     **/
    public Optional getMtu() { return this.mtu; }
   
    public void setMtu(Optional mtu) { 
        this.mtu = (mtu == null) ? Optional.empty() : mtu;
    }
    /** 
     * 
     **/
    public Optional getNetmask() { return this.netmask; }
   
    public void setNetmask(Optional netmask) { 
        this.netmask = (netmask == null) ? Optional.empty() : netmask;
    }
    /** 
     * 
     **/
    public Optional getNetwork() { return this.network; }
   
    public void setNetwork(Optional network) { 
        this.network = (network == null) ? Optional.empty() : network;
    }
    /** 
     * 
     **/
    public Optional getUpAndRunning() { return this.upAndRunning; }
   
    public void setUpAndRunning(Optional upAndRunning) { 
        this.upAndRunning = (upAndRunning == null) ? Optional.empty() : upAndRunning;
    }

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

        PhysicalAdapter that = (PhysicalAdapter) o;

        return 
            Objects.equals(address, that.address) && 
            Objects.equals(macAddress, that.macAddress) && 
            Objects.equals(macAddressPermanent, that.macAddressPermanent) && 
            Objects.equals(mtu, that.mtu) && 
            Objects.equals(netmask, that.netmask) && 
            Objects.equals(network, that.network) && 
            Objects.equals(upAndRunning, that.upAndRunning);
    }

    @Override
    public int hashCode() {
        return Objects.hash( address,macAddress,macAddressPermanent,mtu,netmask,network,upAndRunning );
    }


    public java.util.Map toMap() {
        java.util.Map map = new HashMap<>();
        map.put("address", address);
        map.put("macAddress", macAddress);
        map.put("macAddressPermanent", macAddressPermanent);
        map.put("mtu", mtu);
        map.put("netmask", netmask);
        map.put("network", network);
        map.put("upAndRunning", upAndRunning);
        return map;
    }

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

        if(null != address && address.isPresent()){
            sb.append(" address : ").append(gson.toJson(address)).append(",");
        }
        else{
            sb.append(" address : ").append("null").append(",");
        }
        if(null != macAddress && macAddress.isPresent()){
            sb.append(" macAddress : ").append(gson.toJson(macAddress)).append(",");
        }
        else{
            sb.append(" macAddress : ").append("null").append(",");
        }
        if(null != macAddressPermanent && macAddressPermanent.isPresent()){
            sb.append(" macAddressPermanent : ").append(gson.toJson(macAddressPermanent)).append(",");
        }
        else{
            sb.append(" macAddressPermanent : ").append("null").append(",");
        }
        if(null != mtu && mtu.isPresent()){
            sb.append(" mtu : ").append(gson.toJson(mtu)).append(",");
        }
        else{
            sb.append(" mtu : ").append("null").append(",");
        }
        if(null != netmask && netmask.isPresent()){
            sb.append(" netmask : ").append(gson.toJson(netmask)).append(",");
        }
        else{
            sb.append(" netmask : ").append("null").append(",");
        }
        if(null != network && network.isPresent()){
            sb.append(" network : ").append(gson.toJson(network)).append(",");
        }
        else{
            sb.append(" network : ").append("null").append(",");
        }
        if(null != upAndRunning && upAndRunning.isPresent()){
            sb.append(" upAndRunning : ").append(gson.toJson(upAndRunning)).append(",");
        }
        else{
            sb.append(" upAndRunning : ").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 address;
        private Optional macAddress;
        private Optional macAddressPermanent;
        private Optional mtu;
        private Optional netmask;
        private Optional network;
        private Optional upAndRunning;

        private Builder() { }

        public PhysicalAdapter build() {
            return new PhysicalAdapter (
                         this.address,
                         this.macAddress,
                         this.macAddressPermanent,
                         this.mtu,
                         this.netmask,
                         this.network,
                         this.upAndRunning);
        }

        private PhysicalAdapter.Builder buildFrom(final PhysicalAdapter req) {
            this.address = req.address;
            this.macAddress = req.macAddress;
            this.macAddressPermanent = req.macAddressPermanent;
            this.mtu = req.mtu;
            this.netmask = req.netmask;
            this.network = req.network;
            this.upAndRunning = req.upAndRunning;

            return this;
        }

        public PhysicalAdapter.Builder optionalAddress(final String address) {
            this.address = (address == null) ? Optional.empty() : Optional.of(address);
            return this;
        }

        public PhysicalAdapter.Builder optionalMacAddress(final String macAddress) {
            this.macAddress = (macAddress == null) ? Optional.empty() : Optional.of(macAddress);
            return this;
        }

        public PhysicalAdapter.Builder optionalMacAddressPermanent(final String macAddressPermanent) {
            this.macAddressPermanent = (macAddressPermanent == null) ? Optional.empty() : Optional.of(macAddressPermanent);
            return this;
        }

        public PhysicalAdapter.Builder optionalMtu(final String mtu) {
            this.mtu = (mtu == null) ? Optional.empty() : Optional.of(mtu);
            return this;
        }

        public PhysicalAdapter.Builder optionalNetmask(final String netmask) {
            this.netmask = (netmask == null) ? Optional.empty() : Optional.of(netmask);
            return this;
        }

        public PhysicalAdapter.Builder optionalNetwork(final String network) {
            this.network = (network == null) ? Optional.empty() : Optional.of(network);
            return this;
        }

        public PhysicalAdapter.Builder optionalUpAndRunning(final Boolean upAndRunning) {
            this.upAndRunning = (upAndRunning == null) ? Optional.empty() : Optional.of(upAndRunning);
            return this;
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy