io.fabric8.knative.pkg.apis.FieldErrorFluent Maven / Gradle / Ivy
package io.fabric8.knative.pkg.apis;
import java.lang.SuppressWarnings;
import java.util.ArrayList;
import java.lang.String;
import java.util.LinkedHashMap;
import java.util.function.Predicate;
import java.lang.Integer;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.util.Map;
/**
* Generated
*/
@SuppressWarnings("unchecked")
public class FieldErrorFluent> extends BaseFluent{
public FieldErrorFluent() {
}
public FieldErrorFluent(FieldError instance) {
this.copyInstance(instance);
}
private String details;
private Integer level;
private String message;
private List paths = new ArrayList();
private Map additionalProperties;
protected void copyInstance(FieldError instance) {
instance = (instance != null ? instance : new FieldError());
if (instance != null) {
this.withDetails(instance.getDetails());
this.withLevel(instance.getLevel());
this.withMessage(instance.getMessage());
this.withPaths(instance.getPaths());
this.withAdditionalProperties(instance.getAdditionalProperties());
}
}
public String getDetails() {
return this.details;
}
public A withDetails(String details) {
this.details = details;
return (A) this;
}
public boolean hasDetails() {
return this.details != null;
}
public Integer getLevel() {
return this.level;
}
public A withLevel(Integer level) {
this.level = level;
return (A) this;
}
public boolean hasLevel() {
return this.level != 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 A addToPaths(int index,String item) {
if (this.paths == null) {this.paths = new ArrayList();}
this.paths.add(index, item);
return (A)this;
}
public A setToPaths(int index,String item) {
if (this.paths == null) {this.paths = new ArrayList();}
this.paths.set(index, item); return (A)this;
}
public A addToPaths(java.lang.String... items) {
if (this.paths == null) {this.paths = new ArrayList();}
for (String item : items) {this.paths.add(item);} return (A)this;
}
public A addAllToPaths(Collection items) {
if (this.paths == null) {this.paths = new ArrayList();}
for (String item : items) {this.paths.add(item);} return (A)this;
}
public A removeFromPaths(java.lang.String... items) {
if (this.paths == null) return (A)this;
for (String item : items) { this.paths.remove(item);} return (A)this;
}
public A removeAllFromPaths(Collection items) {
if (this.paths == null) return (A)this;
for (String item : items) { this.paths.remove(item);} return (A)this;
}
public List getPaths() {
return this.paths;
}
public String getPath(int index) {
return this.paths.get(index);
}
public String getFirstPath() {
return this.paths.get(0);
}
public String getLastPath() {
return this.paths.get(paths.size() - 1);
}
public String getMatchingPath(Predicate predicate) {
for (String item : paths) {
if (predicate.test(item)) {
return item;
}
}
return null;
}
public boolean hasMatchingPath(Predicate predicate) {
for (String item : paths) {
if (predicate.test(item)) {
return true;
}
}
return false;
}
public A withPaths(List paths) {
if (paths != null) {
this.paths = new ArrayList();
for (String item : paths) {
this.addToPaths(item);
}
} else {
this.paths = null;
}
return (A) this;
}
public A withPaths(java.lang.String... paths) {
if (this.paths != null) {
this.paths.clear();
_visitables.remove("paths");
}
if (paths != null) {
for (String item : paths) {
this.addToPaths(item);
}
}
return (A) this;
}
public boolean hasPaths() {
return this.paths != null && !this.paths.isEmpty();
}
public A addToAdditionalProperties(String key,Object value) {
if(this.additionalProperties == null && key != null && value != null) { this.additionalProperties = new LinkedHashMap(); }
if(key != null && value != null) {this.additionalProperties.put(key, value);} return (A)this;
}
public A addToAdditionalProperties(Map map) {
if(this.additionalProperties == null && map != null) { this.additionalProperties = new LinkedHashMap(); }
if(map != null) { this.additionalProperties.putAll(map);} return (A)this;
}
public A removeFromAdditionalProperties(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(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 Map getAdditionalProperties() {
return this.additionalProperties;
}
public A withAdditionalProperties(Map additionalProperties) {
if (additionalProperties == null) {
this.additionalProperties = null;
} else {
this.additionalProperties = new LinkedHashMap(additionalProperties);
}
return (A) this;
}
public boolean hasAdditionalProperties() {
return this.additionalProperties != null;
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
FieldErrorFluent that = (FieldErrorFluent) o;
if (!java.util.Objects.equals(details, that.details)) return false;
if (!java.util.Objects.equals(level, that.level)) return false;
if (!java.util.Objects.equals(message, that.message)) return false;
if (!java.util.Objects.equals(paths, that.paths)) return false;
if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(details, level, message, paths, additionalProperties, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (details != null) { sb.append("details:"); sb.append(details + ","); }
if (level != null) { sb.append("level:"); sb.append(level + ","); }
if (message != null) { sb.append("message:"); sb.append(message + ","); }
if (paths != null && !paths.isEmpty()) { sb.append("paths:"); sb.append(paths + ","); }
if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
sb.append("}");
return sb.toString();
}
} © 2015 - 2025 Weber Informatics LLC | Privacy Policy