Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Licensed to the Apache Software Foundation (ASF) under one or more
   * contributor license agreements.  See the NOTICE file distributed with
   * this work for additional information regarding copyright ownership.
   * The ASF licenses this file to You 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.
  */
 package org.jclouds.cloudstack.domain;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 
 import java.net.URI;
 
 
Class NIC

Author(s):
Adrian Cole
 
 public class NIC {
 
    public static Builder<?> builder() {
       return new ConcreteBuilder();
    }
 
    public Builder<?> toBuilder() {
       return new ConcreteBuilder().fromNIC(this);
    }
 
    public abstract static class Builder<T extends Builder<T>> {
       protected abstract T self();
 
       protected String id;
       protected URI broadcastURI;
       protected String gateway;
       protected String IPAddress;
       protected boolean isDefault;
       protected URI isolationURI;
       protected String netmask;
       protected String macAddress;
       protected String networkId;
       protected TrafficType trafficType;
       protected GuestIPType guestIPType;

      

See also:
NIC.getId()
 
       public T id(String id) {
          this. = id;
          return self();
       }

      
 
       public T broadcastURI(URI broadcastURI) {
          this. = broadcastURI;
          return self();
       }

      
 
       public T gateway(String gateway) {
          this. = gateway;
          return self();
       }

      
 
       public T IPAddress(String IPAddress) {
          this. = IPAddress;
          return self();
       }

      

See also:
NIC.isDefault()
 
       public T isDefault(boolean isDefault) {
          this. = isDefault;
          return self();
       }

      
      public T isolationURI(URI isolationURI) {
         this. = isolationURI;
         return self();
      }

      
      public T netmask(String netmask) {
         this. = netmask;
         return self();
      }

      
      public T macAddress(String macAddress) {
         this. = macAddress;
         return self();
      }

      
      public T networkId(String networkId) {
         this. = networkId;
         return self();
      }

      
      public T trafficType(TrafficType trafficType) {
         this. = trafficType;
         return self();
      }

      
      public T guestIPType(GuestIPType guestIPType) {
         this. = guestIPType;
         return self();
      }
      public NIC build() {
      }
      public T fromNIC(NIC in) {
         return this
               .id(in.getId())
               .broadcastURI(in.getBroadcastURI())
               .gateway(in.getGateway())
               .IPAddress(in.getIPAddress())
               .isDefault(in.isDefault())
               .isolationURI(in.getIsolationURI())
               .netmask(in.getNetmask())
               .macAddress(in.getMacAddress())
               .networkId(in.getNetworkId())
               .trafficType(in.getTrafficType())
               .guestIPType(in.getGuestIPType());
      }
   }
   private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
      @Override
      protected ConcreteBuilder self() {
         return this;
      }
   }
   private final String id;
   private final URI broadcastURI;
   private final String gateway;
   private final String IPAddress;
   private final boolean isDefault;
   private final URI isolationURI;
   private final String netmask;
   private final String macAddress;
   private final String networkId;
   private final TrafficType trafficType;
   private final GuestIPType guestIPType;
         "id""broadcasturi""gateway""ipaddress""isdefault""isolationuri""netmask""macaddress""networkid""traffictype""type"
   })
   protected NIC(String id, @Nullable URI broadcastURI, @Nullable String gateway, @Nullable String IPAddressboolean isDefault,
                 @Nullable URI isolationURI, @Nullable String netmask, @Nullable String macAddress, @Nullable String networkId,
                 @Nullable TrafficType trafficType, @Nullable GuestIPType guestIPType) {
      this. = checkNotNull(id"id");
      this. = broadcastURI;
      this. = gateway;
      this. = IPAddress;
      this. = isDefault;
      this. = isolationURI;
      this. = netmask;
      this. = macAddress;
      this. = networkId;
      this. = trafficType;
      this. = guestIPType;
   }

   
the ID of the nic
   public String getId() {
      return this.;
   }

   
the broadcast uri of the nic
   public URI getBroadcastURI() {
      return this.;
   }

   
the gateway of the nic
   public String getGateway() {
      return this.;
   }

   
the ip address of the nic
   public String getIPAddress() {
      return this.;
   }

   
true if nic is default, false otherwise
   public boolean isDefault() {
      return this.;
   }

   
the isolation uri of the nic
   public URI getIsolationURI() {
      return this.;
   }

   
the netmask of the nic
   public String getNetmask() {
      return this.;
   }

   
the MAC Address of the NIC
   public String getMacAddress() {
      return this.;
   }

   
the ID of the corresponding network
   public String getNetworkId() {
      return this.;
   }

   
the traffic type of the nic
   public TrafficType getTrafficType() {
      return this.;
   }

   
the type of the nic
   public GuestIPType getGuestIPType() {
      return this.;
   }
   public int hashCode() {
   }
   public boolean equals(Object obj) {
      if (this == objreturn true;
      if (obj == null || getClass() != obj.getClass()) return false;
      NIC that = NIC.class.cast(obj);
      return Objects.equal(this.that.id)
            && Objects.equal(this.that.broadcastURI)
            && Objects.equal(this.that.gateway)
            && Objects.equal(this.that.IPAddress)
            && Objects.equal(this.that.isDefault)
            && Objects.equal(this.that.isolationURI)
            && Objects.equal(this.that.netmask)
            && Objects.equal(this.that.macAddress)
            && Objects.equal(this.that.networkId)
            && Objects.equal(this.that.trafficType)
            && Objects.equal(this.that.guestIPType);
   }
   protected ToStringHelper string() {
      return Objects.toStringHelper(this)
            .add("id").add("broadcastURI").add("gateway").add("IPAddress")
            .add("isDefault").add("isolationURI").add("netmask").add("macAddress")
            .add("networkId").add("trafficType").add("guestIPType");
   }
   public String toString() {
      return string().toString();
   }
New to GrepCode? Check out our FAQ X