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

io.kubernetes.client.openapi.models.V1IPBlockFluentImpl Maven / Gradle / Ivy

There is a newer version: 23.0.0-legacy
Show newest version
/*
Copyright 2022 The Kubernetes Authors.
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.
*/
package io.kubernetes.client.openapi.models;

import io.kubernetes.client.fluent.BaseFluent;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.function.Predicate;

/** Generated */
@SuppressWarnings(value = "unchecked")
public class V1IPBlockFluentImpl> extends BaseFluent
    implements V1IPBlockFluent {
  public V1IPBlockFluentImpl() {}

  public V1IPBlockFluentImpl(io.kubernetes.client.openapi.models.V1IPBlock instance) {
    this.withCidr(instance.getCidr());

    this.withExcept(instance.getExcept());
  }

  private String cidr;
  private List except;

  public java.lang.String getCidr() {
    return this.cidr;
  }

  public A withCidr(java.lang.String cidr) {
    this.cidr = cidr;
    return (A) this;
  }

  public Boolean hasCidr() {
    return this.cidr != null;
  }

  public A addToExcept(Integer index, java.lang.String item) {
    if (this.except == null) {
      this.except = new ArrayList();
    }
    this.except.add(index, item);
    return (A) this;
  }

  public A setToExcept(java.lang.Integer index, java.lang.String item) {
    if (this.except == null) {
      this.except = new java.util.ArrayList();
    }
    this.except.set(index, item);
    return (A) this;
  }

  public A addToExcept(java.lang.String... items) {
    if (this.except == null) {
      this.except = new java.util.ArrayList();
    }
    for (java.lang.String item : items) {
      this.except.add(item);
    }
    return (A) this;
  }

  public A addAllToExcept(Collection items) {
    if (this.except == null) {
      this.except = new java.util.ArrayList();
    }
    for (java.lang.String item : items) {
      this.except.add(item);
    }
    return (A) this;
  }

  public A removeFromExcept(java.lang.String... items) {
    for (java.lang.String item : items) {
      if (this.except != null) {
        this.except.remove(item);
      }
    }
    return (A) this;
  }

  public A removeAllFromExcept(java.util.Collection items) {
    for (java.lang.String item : items) {
      if (this.except != null) {
        this.except.remove(item);
      }
    }
    return (A) this;
  }

  public java.util.List getExcept() {
    return this.except;
  }

  public java.lang.String getExcept(java.lang.Integer index) {
    return this.except.get(index);
  }

  public java.lang.String getFirstExcept() {
    return this.except.get(0);
  }

  public java.lang.String getLastExcept() {
    return this.except.get(except.size() - 1);
  }

  public java.lang.String getMatchingExcept(Predicate predicate) {
    for (java.lang.String item : except) {
      if (predicate.test(item)) {
        return item;
      }
    }
    return null;
  }

  public java.lang.Boolean hasMatchingExcept(
      java.util.function.Predicate predicate) {
    for (java.lang.String item : except) {
      if (predicate.test(item)) {
        return true;
      }
    }
    return false;
  }

  public A withExcept(java.util.List except) {
    if (except != null) {
      this.except = new java.util.ArrayList();
      for (java.lang.String item : except) {
        this.addToExcept(item);
      }
    } else {
      this.except = null;
    }
    return (A) this;
  }

  public A withExcept(java.lang.String... except) {
    if (this.except != null) {
      this.except.clear();
    }
    if (except != null) {
      for (java.lang.String item : except) {
        this.addToExcept(item);
      }
    }
    return (A) this;
  }

  public java.lang.Boolean hasExcept() {
    return except != null && !except.isEmpty();
  }

  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    V1IPBlockFluentImpl that = (V1IPBlockFluentImpl) o;
    if (cidr != null ? !cidr.equals(that.cidr) : that.cidr != null) return false;
    if (except != null ? !except.equals(that.except) : that.except != null) return false;
    return true;
  }

  public int hashCode() {
    return java.util.Objects.hash(cidr, except, super.hashCode());
  }

  public java.lang.String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (cidr != null) {
      sb.append("cidr:");
      sb.append(cidr + ",");
    }
    if (except != null && !except.isEmpty()) {
      sb.append("except:");
      sb.append(except);
    }
    sb.append("}");
    return sb.toString();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy