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

io.fabric8.kubernetes.api.model.HostAliasFluentImpl Maven / Gradle / Ivy

package io.fabric8.kubernetes.api.model;

import java.util.ArrayList;
import java.lang.String;
import java.util.LinkedHashMap;
import java.util.function.Predicate;
import java.lang.Integer;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.lang.Boolean;
import java.util.Map;

 /**
  * Generated
  */
public class HostAliasFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements io.fabric8.kubernetes.api.model.HostAliasFluent{
  public HostAliasFluentImpl() {
  }
  public HostAliasFluentImpl(io.fabric8.kubernetes.api.model.HostAlias instance) {
    this.withHostnames(instance.getHostnames()); 
    this.withIp(instance.getIp()); 
    this.withAdditionalProperties(instance.getAdditionalProperties());

  }
  private java.util.List hostnames = new java.util.ArrayList();
  private java.lang.String ip;
  private java.util.Map additionalProperties;
  public A addToHostnames(java.lang.Integer index,java.lang.String item) {
    if (this.hostnames == null) {this.hostnames = new java.util.ArrayList();}
    this.hostnames.add(index, item);
    return (A)this;
  }
  public A setToHostnames(java.lang.Integer index,java.lang.String item) {
    if (this.hostnames == null) {this.hostnames = new java.util.ArrayList();}
    this.hostnames.set(index, item); return (A)this;
  }
  public A addToHostnames(java.lang.String... items) {
    if (this.hostnames == null) {this.hostnames = new java.util.ArrayList();}
    for (java.lang.String item : items) {this.hostnames.add(item);} return (A)this;
  }
  public A addAllToHostnames(java.util.Collection items) {
    if (this.hostnames == null) {this.hostnames = new java.util.ArrayList();}
    for (java.lang.String item : items) {this.hostnames.add(item);} return (A)this;
  }
  public A removeFromHostnames(java.lang.String... items) {
    for (java.lang.String item : items) {if (this.hostnames!= null){ this.hostnames.remove(item);}} return (A)this;
  }
  public A removeAllFromHostnames(java.util.Collection items) {
    for (java.lang.String item : items) {if (this.hostnames!= null){ this.hostnames.remove(item);}} return (A)this;
  }
  public java.util.List getHostnames() {
    return this.hostnames;
  }
  public java.lang.String getHostname(java.lang.Integer index) {
    return this.hostnames.get(index);
  }
  public java.lang.String getFirstHostname() {
    return this.hostnames.get(0);
  }
  public java.lang.String getLastHostname() {
    return this.hostnames.get(hostnames.size() - 1);
  }
  public java.lang.String getMatchingHostname(java.util.function.Predicate predicate) {
    for (java.lang.String item: hostnames) { if(predicate.test(item)){ return item;} } return null;
  }
  public java.lang.Boolean hasMatchingHostname(java.util.function.Predicate predicate) {
    for (java.lang.String item: hostnames) { if(predicate.test(item)){ return true;} } return false;
  }
  public A withHostnames(java.util.List hostnames) {
    if (hostnames != null) {this.hostnames = new java.util.ArrayList(); for (java.lang.String item : hostnames){this.addToHostnames(item);}} else { this.hostnames = null;} return (A) this;
  }
  public A withHostnames(java.lang.String... hostnames) {
    if (this.hostnames != null) {this.hostnames.clear();}
    if (hostnames != null) {for (java.lang.String item :hostnames){ this.addToHostnames(item);}} return (A) this;
  }
  public java.lang.Boolean hasHostnames() {
    return hostnames != null && !hostnames.isEmpty();
  }
  public A addNewHostname(java.lang.String arg0) {
    return (A)addToHostnames(new String(arg0));
  }
  public java.lang.String getIp() {
    return this.ip;
  }
  public A withIp(java.lang.String ip) {
    this.ip=ip; return (A) this;
  }
  public java.lang.Boolean hasIp() {
    return this.ip != null;
  }
  
  /**
   * Method is deprecated. use withIp instead.
   */
  @java.lang.Deprecated
  public A withNewIp(java.lang.String arg0) {
    return (A)withIp(new String(arg0));
  }
  public A addToAdditionalProperties(java.lang.String key,java.lang.Object value) {
    if(this.additionalProperties == null && key != null && value != null) { this.additionalProperties = new java.util.LinkedHashMap(); }
    if(key != null && value != null) {this.additionalProperties.put(key, value);} return (A)this;
  }
  public A addToAdditionalProperties(java.util.Map map) {
    if(this.additionalProperties == null && map != null) { this.additionalProperties = new java.util.LinkedHashMap(); }
    if(map != null) { this.additionalProperties.putAll(map);} return (A)this;
  }
  public A removeFromAdditionalProperties(java.lang.String key) {
    if(this.additionalProperties == null) { return (A) this; }
    if(key != null && this.additionalProperties != null) {this.additionalProperties.remove(key);} return (A)this;
  }
  public A removeFromAdditionalProperties(java.util.Map map) {
    if(this.additionalProperties == null) { return (A) this; }
    if(map != null) { for(Object key : map.keySet()) {if (this.additionalProperties != null){this.additionalProperties.remove(key);}}} return (A)this;
  }
  public java.util.Map getAdditionalProperties() {
    return this.additionalProperties;
  }
  public A withAdditionalProperties(java.util.Map additionalProperties) {
    if (additionalProperties == null) { this.additionalProperties =  null;} else {this.additionalProperties = new java.util.LinkedHashMap(additionalProperties);} return (A) this;
  }
  public java.lang.Boolean hasAdditionalProperties() {
    return this.additionalProperties != null;
  }
  public boolean equals(java.lang.Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    HostAliasFluentImpl that = (HostAliasFluentImpl) o;
    if (hostnames != null ? !hostnames.equals(that.hostnames) :that.hostnames != null) return false;
    if (ip != null ? !ip.equals(that.ip) :that.ip != null) return false;
    if (additionalProperties != null ? !additionalProperties.equals(that.additionalProperties) :that.additionalProperties != null) return false;
    return true;
  }
  public int hashCode() {
    return java.util.Objects.hash(hostnames,  ip,  additionalProperties,  super.hashCode());
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy