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

io.fabric8.kubernetes.api.model.batch.v1.CronJobStatusFluentImpl Maven / Gradle / Ivy

package io.fabric8.kubernetes.api.model.batch.v1;

import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import io.fabric8.kubernetes.api.builder.Nested;
import java.util.ArrayList;
import io.fabric8.kubernetes.api.model.ObjectReferenceFluentImpl;
import java.lang.String;
import java.util.LinkedHashMap;
import java.util.function.Predicate;
import java.lang.Integer;
import io.fabric8.kubernetes.api.model.ObjectReference;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.model.ObjectReferenceBuilder;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.util.Iterator;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.lang.Boolean;
import java.util.Map;

 /**
  * Generated
  */
public class CronJobStatusFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements io.fabric8.kubernetes.api.model.batch.v1.CronJobStatusFluent{
  public CronJobStatusFluentImpl() {
  }
  public CronJobStatusFluentImpl(io.fabric8.kubernetes.api.model.batch.v1.CronJobStatus instance) {
    this.withActive(instance.getActive()); 
    this.withLastScheduleTime(instance.getLastScheduleTime()); 
    this.withLastSuccessfulTime(instance.getLastSuccessfulTime()); 
    this.withAdditionalProperties(instance.getAdditionalProperties());

  }
  private java.util.List active =  new java.util.ArrayList();
  private java.lang.String lastScheduleTime;
  private java.lang.String lastSuccessfulTime;
  private java.util.Map additionalProperties;
  public A addToActive(java.lang.Integer index,io.fabric8.kubernetes.api.model.ObjectReference item) {
    if (this.active == null) {this.active = new java.util.ArrayList();}
    io.fabric8.kubernetes.api.model.ObjectReferenceBuilder builder = new io.fabric8.kubernetes.api.model.ObjectReferenceBuilder(item);_visitables.get("active").add(index >= 0 ? index : _visitables.get("active").size(), builder);this.active.add(index >= 0 ? index : active.size(), builder); return (A)this;
  }
  public A setToActive(java.lang.Integer index,io.fabric8.kubernetes.api.model.ObjectReference item) {
    if (this.active == null) {this.active = new java.util.ArrayList();}
    io.fabric8.kubernetes.api.model.ObjectReferenceBuilder builder = new io.fabric8.kubernetes.api.model.ObjectReferenceBuilder(item);
    if (index < 0 || index >= _visitables.get("active").size()) { _visitables.get("active").add(builder); } else { _visitables.get("active").set(index, builder);}
    if (index < 0 || index >= active.size()) { active.add(builder); } else { active.set(index, builder);}
     return (A)this;
  }
  public A addToActive(io.fabric8.kubernetes.api.model.ObjectReference... items) {
    if (this.active == null) {this.active = new java.util.ArrayList();}
    for (io.fabric8.kubernetes.api.model.ObjectReference item : items) {io.fabric8.kubernetes.api.model.ObjectReferenceBuilder builder = new io.fabric8.kubernetes.api.model.ObjectReferenceBuilder(item);_visitables.get("active").add(builder);this.active.add(builder);} return (A)this;
  }
  public A addAllToActive(java.util.Collection items) {
    if (this.active == null) {this.active = new java.util.ArrayList();}
    for (io.fabric8.kubernetes.api.model.ObjectReference item : items) {io.fabric8.kubernetes.api.model.ObjectReferenceBuilder builder = new io.fabric8.kubernetes.api.model.ObjectReferenceBuilder(item);_visitables.get("active").add(builder);this.active.add(builder);} return (A)this;
  }
  public A removeFromActive(io.fabric8.kubernetes.api.model.ObjectReference... items) {
    for (io.fabric8.kubernetes.api.model.ObjectReference item : items) {io.fabric8.kubernetes.api.model.ObjectReferenceBuilder builder = new io.fabric8.kubernetes.api.model.ObjectReferenceBuilder(item);_visitables.get("active").remove(builder);if (this.active != null) {this.active.remove(builder);}} return (A)this;
  }
  public A removeAllFromActive(java.util.Collection items) {
    for (io.fabric8.kubernetes.api.model.ObjectReference item : items) {io.fabric8.kubernetes.api.model.ObjectReferenceBuilder builder = new io.fabric8.kubernetes.api.model.ObjectReferenceBuilder(item);_visitables.get("active").remove(builder);if (this.active != null) {this.active.remove(builder);}} return (A)this;
  }
  public A removeMatchingFromActive(java.util.function.Predicate predicate) {
    if (active == null) return (A) this;
    final Iterator each = active.iterator();
    final List visitables = _visitables.get("active");
    while (each.hasNext()) {
      io.fabric8.kubernetes.api.model.ObjectReferenceBuilder builder = each.next();
      if (predicate.test(builder)) {
        visitables.remove(builder);
        each.remove();
      }
    }
    return (A)this;
  }
  
  /**
   * This method has been deprecated, please use method buildActive instead.
   * @return The buildable object.
   */
  @java.lang.Deprecated
  public java.util.List getActive() {
    return build(active);
  }
  public java.util.List buildActive() {
    return build(active);
  }
  public io.fabric8.kubernetes.api.model.ObjectReference buildActive(java.lang.Integer index) {
    return this.active.get(index).build();
  }
  public io.fabric8.kubernetes.api.model.ObjectReference buildFirstActive() {
    return this.active.get(0).build();
  }
  public io.fabric8.kubernetes.api.model.ObjectReference buildLastActive() {
    return this.active.get(active.size() - 1).build();
  }
  public io.fabric8.kubernetes.api.model.ObjectReference buildMatchingActive(java.util.function.Predicate predicate) {
    for (io.fabric8.kubernetes.api.model.ObjectReferenceBuilder item: active) { if(predicate.test(item)){ return item.build();} } return null;
  }
  public java.lang.Boolean hasMatchingActive(java.util.function.Predicate predicate) {
    for (io.fabric8.kubernetes.api.model.ObjectReferenceBuilder item: active) { if(predicate.test(item)){ return true;} } return false;
  }
  public A withActive(java.util.List active) {
    if (this.active != null) { _visitables.get("active").removeAll(this.active);}
    if (active != null) {this.active = new java.util.ArrayList(); for (io.fabric8.kubernetes.api.model.ObjectReference item : active){this.addToActive(item);}} else { this.active = null;} return (A) this;
  }
  public A withActive(io.fabric8.kubernetes.api.model.ObjectReference... active) {
    if (this.active != null) {this.active.clear();}
    if (active != null) {for (io.fabric8.kubernetes.api.model.ObjectReference item :active){ this.addToActive(item);}} return (A) this;
  }
  public java.lang.Boolean hasActive() {
    return active != null && !active.isEmpty();
  }
  public io.fabric8.kubernetes.api.model.batch.v1.CronJobStatusFluent.ActiveNested addNewActive() {
    return new io.fabric8.kubernetes.api.model.batch.v1.CronJobStatusFluentImpl.ActiveNestedImpl();
  }
  public io.fabric8.kubernetes.api.model.batch.v1.CronJobStatusFluent.ActiveNested addNewActiveLike(io.fabric8.kubernetes.api.model.ObjectReference item) {
    return new io.fabric8.kubernetes.api.model.batch.v1.CronJobStatusFluentImpl.ActiveNestedImpl(-1, item);
  }
  public io.fabric8.kubernetes.api.model.batch.v1.CronJobStatusFluent.ActiveNested setNewActiveLike(java.lang.Integer index,io.fabric8.kubernetes.api.model.ObjectReference item) {
    return new io.fabric8.kubernetes.api.model.batch.v1.CronJobStatusFluentImpl.ActiveNestedImpl(index, item);
  }
  public io.fabric8.kubernetes.api.model.batch.v1.CronJobStatusFluent.ActiveNested editActive(java.lang.Integer index) {
    if (active.size() <= index) throw new RuntimeException("Can't edit active. Index exceeds size.");
    return setNewActiveLike(index, buildActive(index));
  }
  public io.fabric8.kubernetes.api.model.batch.v1.CronJobStatusFluent.ActiveNested editFirstActive() {
    if (active.size() == 0) throw new RuntimeException("Can't edit first active. The list is empty.");
    return setNewActiveLike(0, buildActive(0));
  }
  public io.fabric8.kubernetes.api.model.batch.v1.CronJobStatusFluent.ActiveNested editLastActive() {
    int index = active.size() - 1;
    if (index < 0) throw new RuntimeException("Can't edit last active. The list is empty.");
    return setNewActiveLike(index, buildActive(index));
  }
  public io.fabric8.kubernetes.api.model.batch.v1.CronJobStatusFluent.ActiveNested editMatchingActive(java.util.function.Predicate predicate) {
    int index = -1;
    for (int i=0;i 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;
    CronJobStatusFluentImpl that = (CronJobStatusFluentImpl) o;
    if (active != null ? !active.equals(that.active) :that.active != null) return false;
    if (lastScheduleTime != null ? !lastScheduleTime.equals(that.lastScheduleTime) :that.lastScheduleTime != null) return false;
    if (lastSuccessfulTime != null ? !lastSuccessfulTime.equals(that.lastSuccessfulTime) :that.lastSuccessfulTime != 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(active,  lastScheduleTime,  lastSuccessfulTime,  additionalProperties,  super.hashCode());
  }
  public class ActiveNestedImpl extends io.fabric8.kubernetes.api.model.ObjectReferenceFluentImpl> implements io.fabric8.kubernetes.api.model.batch.v1.CronJobStatusFluent.ActiveNested,io.fabric8.kubernetes.api.builder.Nested{
    ActiveNestedImpl(java.lang.Integer index,io.fabric8.kubernetes.api.model.ObjectReference item) {
      this.index = index;
      this.builder = new io.fabric8.kubernetes.api.model.ObjectReferenceBuilder(this, item);
    }
    ActiveNestedImpl() {
      this.index = -1;
      this.builder = new io.fabric8.kubernetes.api.model.ObjectReferenceBuilder(this);
    }
    io.fabric8.kubernetes.api.model.ObjectReferenceBuilder builder;
    java.lang.Integer index;
    public N and() {
      return (N) CronJobStatusFluentImpl.this.setToActive(index,builder.build());
    }
    public N endActive() {
      return and();
    }
    
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy