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

io.github.microcks.operator.api.base.v1alpha1.MicrocksStatusFluent Maven / Gradle / Ivy

package io.github.microcks.operator.api.base.v1alpha1;

import io.github.microcks.operator.api.model.Condition;
import io.github.microcks.operator.api.model.Status;
import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.util.ArrayList;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.lang.String;
import java.util.function.Predicate;

/**
 * Generated
 */
@SuppressWarnings("unchecked")
public class MicrocksStatusFluent> extends BaseFluent{
  public MicrocksStatusFluent() {
  }
  
  public MicrocksStatusFluent(MicrocksStatus instance) {
    this.copyInstance(instance);
  }
  private Status status;
  private String message;
  private String microcksUrl;
  private String keycloakUrl;
  private long observedGeneration;
  private List conditions = new ArrayList();
  
  protected void copyInstance(MicrocksStatus instance) {
    instance = (instance != null ? instance : new MicrocksStatus());
    if (instance != null) {
          this.withStatus(instance.getStatus());
          this.withMessage(instance.getMessage());
          this.withMicrocksUrl(instance.getMicrocksUrl());
          this.withKeycloakUrl(instance.getKeycloakUrl());
          this.withObservedGeneration(instance.getObservedGeneration());
          this.withConditions(instance.getConditions());
        }
  }
  
  public Status getStatus() {
    return this.status;
  }
  
  public A withStatus(Status status) {
    this.status = status;
    return (A) this;
  }
  
  public boolean hasStatus() {
    return this.status != null;
  }
  
  public String getMessage() {
    return this.message;
  }
  
  public A withMessage(String message) {
    this.message = message;
    return (A) this;
  }
  
  public boolean hasMessage() {
    return this.message != null;
  }
  
  public String getMicrocksUrl() {
    return this.microcksUrl;
  }
  
  public A withMicrocksUrl(String microcksUrl) {
    this.microcksUrl = microcksUrl;
    return (A) this;
  }
  
  public boolean hasMicrocksUrl() {
    return this.microcksUrl != null;
  }
  
  public String getKeycloakUrl() {
    return this.keycloakUrl;
  }
  
  public A withKeycloakUrl(String keycloakUrl) {
    this.keycloakUrl = keycloakUrl;
    return (A) this;
  }
  
  public boolean hasKeycloakUrl() {
    return this.keycloakUrl != null;
  }
  
  public long getObservedGeneration() {
    return this.observedGeneration;
  }
  
  public A withObservedGeneration(long observedGeneration) {
    this.observedGeneration = observedGeneration;
    return (A) this;
  }
  
  public boolean hasObservedGeneration() {
    return true;
  }
  
  public A addToConditions(int index,Condition item) {
    if (this.conditions == null) {this.conditions = new ArrayList();}
    this.conditions.add(index, item);
    return (A)this;
  }
  
  public A setToConditions(int index,Condition item) {
    if (this.conditions == null) {this.conditions = new ArrayList();}
    this.conditions.set(index, item); return (A)this;
  }
  
  public A addToConditions(io.github.microcks.operator.api.model.Condition... items) {
    if (this.conditions == null) {this.conditions = new ArrayList();}
    for (Condition item : items) {this.conditions.add(item);} return (A)this;
  }
  
  public A addAllToConditions(Collection items) {
    if (this.conditions == null) {this.conditions = new ArrayList();}
    for (Condition item : items) {this.conditions.add(item);} return (A)this;
  }
  
  public A removeFromConditions(io.github.microcks.operator.api.model.Condition... items) {
    if (this.conditions == null) return (A)this;
    for (Condition item : items) { this.conditions.remove(item);} return (A)this;
  }
  
  public A removeAllFromConditions(Collection items) {
    if (this.conditions == null) return (A)this;
    for (Condition item : items) { this.conditions.remove(item);} return (A)this;
  }
  
  public List getConditions() {
    return this.conditions;
  }
  
  public Condition getCondition(int index) {
    return this.conditions.get(index);
  }
  
  public Condition getFirstCondition() {
    return this.conditions.get(0);
  }
  
  public Condition getLastCondition() {
    return this.conditions.get(conditions.size() - 1);
  }
  
  public Condition getMatchingCondition(Predicate predicate) {
      for (Condition item : conditions) {
        if (predicate.test(item)) {
          return item;
        }
      }
      return null;
  }
  
  public boolean hasMatchingCondition(Predicate predicate) {
      for (Condition item : conditions) {
        if (predicate.test(item)) {
          return true;
        }
      }
      return false;
  }
  
  public A withConditions(List conditions) {
    if (conditions != null) {
        this.conditions = new ArrayList();
        for (Condition item : conditions) {
          this.addToConditions(item);
        }
    } else {
      this.conditions = null;
    }
    return (A) this;
  }
  
  public A withConditions(io.github.microcks.operator.api.model.Condition... conditions) {
    if (this.conditions != null) {
        this.conditions.clear();
        _visitables.remove("conditions");
    }
    if (conditions != null) {
      for (Condition item : conditions) {
        this.addToConditions(item);
      }
    }
    return (A) this;
  }
  
  public boolean hasConditions() {
    return this.conditions != null && !this.conditions.isEmpty();
  }
  
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    if (!super.equals(o)) return false;
    MicrocksStatusFluent that = (MicrocksStatusFluent) o;
    if (!java.util.Objects.equals(status, that.status)) return false;
    if (!java.util.Objects.equals(message, that.message)) return false;
    if (!java.util.Objects.equals(microcksUrl, that.microcksUrl)) return false;
    if (!java.util.Objects.equals(keycloakUrl, that.keycloakUrl)) return false;
    if (observedGeneration != that.observedGeneration) return false;
    if (!java.util.Objects.equals(conditions, that.conditions)) return false;
    return true;
  }
  
  public int hashCode() {
    return java.util.Objects.hash(status,  message,  microcksUrl,  keycloakUrl,  observedGeneration,  conditions,  super.hashCode());
  }
  
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (status != null) { sb.append("status:"); sb.append(status + ","); }
    if (message != null) { sb.append("message:"); sb.append(message + ","); }
    if (microcksUrl != null) { sb.append("microcksUrl:"); sb.append(microcksUrl + ","); }
    if (keycloakUrl != null) { sb.append("keycloakUrl:"); sb.append(keycloakUrl + ","); }
    sb.append("observedGeneration:"); sb.append(observedGeneration + ",");
    if (conditions != null && !conditions.isEmpty()) { sb.append("conditions:"); sb.append(conditions); }
    sb.append("}");
    return sb.toString();
  }
  

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy