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

org.jclouds.googlecomputeengine.domain.AutoValue_Firewall_Rule Maven / Gradle / Ivy

The newest version!

package org.jclouds.googlecomputeengine.domain;

import java.util.List;
import javax.annotation.Generated;
import org.jclouds.javax.annotation.Nullable;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
 final class AutoValue_Firewall_Rule extends Firewall.Rule {

  private final String ipProtocol;
  private final List ports;

  AutoValue_Firewall_Rule(
      String ipProtocol,
      @Nullable List ports) {
    if (ipProtocol == null) {
      throw new NullPointerException("Null ipProtocol");
    }
    this.ipProtocol = ipProtocol;
    this.ports = ports;
  }

  @Override
  public String ipProtocol() {
    return ipProtocol;
  }

  @Nullable
  @Override
  public List ports() {
    return ports;
  }

  @Override
  public String toString() {
    return "Rule{"
        + "ipProtocol=" + ipProtocol + ", "
        + "ports=" + ports
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof Firewall.Rule) {
      Firewall.Rule that = (Firewall.Rule) o;
      return (this.ipProtocol.equals(that.ipProtocol()))
           && ((this.ports == null) ? (that.ports() == null) : this.ports.equals(that.ports()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h = 1;
    h *= 1000003;
    h ^= this.ipProtocol.hashCode();
    h *= 1000003;
    h ^= (ports == null) ? 0 : this.ports.hashCode();
    return h;
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy