io.fabric8.knative.sources.v1.APIVersionKindSelectorFluent Maven / Gradle / Ivy
package io.fabric8.knative.sources.v1;
import io.fabric8.kubernetes.api.model.LabelSelectorBuilder;
import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import io.fabric8.kubernetes.api.builder.Nested;
import io.fabric8.kubernetes.api.model.LabelSelector;
import java.lang.Object;
import io.fabric8.kubernetes.api.model.LabelSelectorFluent;
import java.lang.String;
/**
* Generated
*/
@SuppressWarnings(value = "unchecked")
public class APIVersionKindSelectorFluent> extends BaseFluent{
public APIVersionKindSelectorFluent() {
}
public APIVersionKindSelectorFluent(APIVersionKindSelector instance) {
instance = (instance != null ? instance : new APIVersionKindSelector());
if (instance != null) {
this.withApiVersion(instance.getApiVersion());
this.withKind(instance.getKind());
this.withSelector(instance.getSelector());
this.withApiVersion(instance.getApiVersion());
this.withKind(instance.getKind());
this.withSelector(instance.getSelector());
}
}
private String apiVersion;
private String kind;
private LabelSelectorBuilder selector;
public String getApiVersion() {
return this.apiVersion;
}
public A withApiVersion(String apiVersion) {
this.apiVersion=apiVersion; return (A) this;
}
public boolean hasApiVersion() {
return this.apiVersion != null;
}
public String getKind() {
return this.kind;
}
public A withKind(String kind) {
this.kind=kind; return (A) this;
}
public boolean hasKind() {
return this.kind != null;
}
public LabelSelector buildSelector() {
return this.selector!=null ?this.selector.build():null;
}
public A withSelector(LabelSelector selector) {
_visitables.get("selector").remove(this.selector);
if (selector!=null){ this.selector= new LabelSelectorBuilder(selector); _visitables.get("selector").add(this.selector);} else { this.selector = null; _visitables.get("selector").remove(this.selector); } return (A) this;
}
public boolean hasSelector() {
return this.selector != null;
}
public SelectorNested withNewSelector() {
return new SelectorNested(null);
}
public SelectorNested withNewSelectorLike(LabelSelector item) {
return new SelectorNested(item);
}
public SelectorNested editSelector() {
return withNewSelectorLike(java.util.Optional.ofNullable(buildSelector()).orElse(null));
}
public SelectorNested editOrNewSelector() {
return withNewSelectorLike(java.util.Optional.ofNullable(buildSelector()).orElse(new LabelSelectorBuilder().build()));
}
public SelectorNested editOrNewSelectorLike(LabelSelector item) {
return withNewSelectorLike(java.util.Optional.ofNullable(buildSelector()).orElse(item));
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
APIVersionKindSelectorFluent that = (APIVersionKindSelectorFluent) o;
if (!java.util.Objects.equals(apiVersion, that.apiVersion)) return false;
if (!java.util.Objects.equals(kind, that.kind)) return false;
if (!java.util.Objects.equals(selector, that.selector)) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(apiVersion, kind, selector, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (apiVersion != null) { sb.append("apiVersion:"); sb.append(apiVersion + ","); }
if (kind != null) { sb.append("kind:"); sb.append(kind + ","); }
if (selector != null) { sb.append("selector:"); sb.append(selector); }
sb.append("}");
return sb.toString();
}
public class SelectorNested extends LabelSelectorFluent> implements Nested{
SelectorNested(LabelSelector item) {
this.builder = new LabelSelectorBuilder(this, item);
}
LabelSelectorBuilder builder;
public N and() {
return (N) APIVersionKindSelectorFluent.this.withSelector(builder.build());
}
public N endSelector() {
return and();
}
}
} © 2015 - 2025 Weber Informatics LLC | Privacy Policy