io.fabric8.knative.internal.pkg.tracker.ReferenceFluentImpl Maven / Gradle / Ivy
package io.fabric8.knative.internal.pkg.tracker;
import io.fabric8.kubernetes.api.model.LabelSelectorBuilder;
import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.model.LabelSelectorFluentImpl;
import io.fabric8.kubernetes.api.builder.Nested;
import io.fabric8.kubernetes.api.model.LabelSelector;
import java.lang.String;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;
/**
* Generated
*/
@SuppressWarnings(value = "unchecked")
public class ReferenceFluentImpl> extends BaseFluent implements ReferenceFluent{
public ReferenceFluentImpl() {
}
public ReferenceFluentImpl(Reference instance) {
this.withApiVersion(instance.getApiVersion());
this.withKind(instance.getKind());
this.withName(instance.getName());
this.withNamespace(instance.getNamespace());
this.withSelector(instance.getSelector());
}
private String apiVersion;
private String kind;
private String name;
private String namespace;
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 String getName() {
return this.name;
}
public A withName(String name) {
this.name=name; return (A) this;
}
public Boolean hasName() {
return this.name != null;
}
public String getNamespace() {
return this.namespace;
}
public A withNamespace(String namespace) {
this.namespace=namespace; return (A) this;
}
public Boolean hasNamespace() {
return this.namespace != null;
}
/**
* This method has been deprecated, please use method buildSelector instead.
* @return The buildable object.
*/
@Deprecated
public LabelSelector getSelector() {
return this.selector!=null ?this.selector.build():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 ReferenceFluent.SelectorNested withNewSelector() {
return new ReferenceFluentImpl.SelectorNestedImpl();
}
public ReferenceFluent.SelectorNested withNewSelectorLike(LabelSelector item) {
return new ReferenceFluentImpl.SelectorNestedImpl(item);
}
public ReferenceFluent.SelectorNested editSelector() {
return withNewSelectorLike(getSelector());
}
public ReferenceFluent.SelectorNested editOrNewSelector() {
return withNewSelectorLike(getSelector() != null ? getSelector(): new LabelSelectorBuilder().build());
}
public ReferenceFluent.SelectorNested editOrNewSelectorLike(LabelSelector item) {
return withNewSelectorLike(getSelector() != null ? getSelector(): item);
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ReferenceFluentImpl that = (ReferenceFluentImpl) o;
if (apiVersion != null ? !apiVersion.equals(that.apiVersion) :that.apiVersion != null) return false;
if (kind != null ? !kind.equals(that.kind) :that.kind != null) return false;
if (name != null ? !name.equals(that.name) :that.name != null) return false;
if (namespace != null ? !namespace.equals(that.namespace) :that.namespace != null) return false;
if (selector != null ? !selector.equals(that.selector) :that.selector != null) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(apiVersion, kind, name, namespace, 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 (name != null) { sb.append("name:"); sb.append(name + ","); }
if (namespace != null) { sb.append("namespace:"); sb.append(namespace + ","); }
if (selector != null) { sb.append("selector:"); sb.append(selector); }
sb.append("}");
return sb.toString();
}
class SelectorNestedImpl extends LabelSelectorFluentImpl> implements ReferenceFluent.SelectorNested,Nested{
SelectorNestedImpl(LabelSelector item) {
this.builder = new LabelSelectorBuilder(this, item);
}
SelectorNestedImpl() {
this.builder = new LabelSelectorBuilder(this);
}
LabelSelectorBuilder builder;
public N and() {
return (N) ReferenceFluentImpl.this.withSelector(builder.build());
}
public N endSelector() {
return and();
}
}
} © 2015 - 2025 Weber Informatics LLC | Privacy Policy