
io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluentImpl Maven / Gradle / Ivy
package io.fabric8.kubernetes.api.model.apiextensions.v1;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import io.fabric8.kubernetes.api.builder.Nested;
import java.util.ArrayList;
import java.lang.String;
import java.util.LinkedHashMap;
import java.util.function.Predicate;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.util.Iterator;
import java.util.List;
import java.lang.Boolean;
import java.lang.Integer;
import java.util.Collection;
import java.lang.Object;
import java.util.Map;
/**
* Generated
*/
public class JSONSchemaPropsOrArrayFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluent{
public JSONSchemaPropsOrArrayFluentImpl() {
}
public JSONSchemaPropsOrArrayFluentImpl(io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArray instance) {
this.withJSONSchemas(instance.getJSONSchemas());
this.withSchema(instance.getSchema());
this.withAdditionalProperties(instance.getAdditionalProperties());
}
private java.util.List jSONSchemas = new java.util.ArrayList();
private io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder schema;
private java.util.Map additionalProperties;
public A addToJSONSchemas(java.lang.Integer index,io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps item) {
if (this.jSONSchemas == null) {this.jSONSchemas = new java.util.ArrayList();}
io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder builder = new io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder(item);_visitables.get("jSONSchemas").add(index >= 0 ? index : _visitables.get("jSONSchemas").size(), builder);this.jSONSchemas.add(index >= 0 ? index : jSONSchemas.size(), builder); return (A)this;
}
public A setToJSONSchemas(java.lang.Integer index,io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps item) {
if (this.jSONSchemas == null) {this.jSONSchemas = new java.util.ArrayList();}
io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder builder = new io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder(item);
if (index < 0 || index >= _visitables.get("jSONSchemas").size()) { _visitables.get("jSONSchemas").add(builder); } else { _visitables.get("jSONSchemas").set(index, builder);}
if (index < 0 || index >= jSONSchemas.size()) { jSONSchemas.add(builder); } else { jSONSchemas.set(index, builder);}
return (A)this;
}
public A addToJSONSchemas(io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps... items) {
if (this.jSONSchemas == null) {this.jSONSchemas = new java.util.ArrayList();}
for (io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps item : items) {io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder builder = new io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder(item);_visitables.get("jSONSchemas").add(builder);this.jSONSchemas.add(builder);} return (A)this;
}
public A addAllToJSONSchemas(java.util.Collection items) {
if (this.jSONSchemas == null) {this.jSONSchemas = new java.util.ArrayList();}
for (io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps item : items) {io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder builder = new io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder(item);_visitables.get("jSONSchemas").add(builder);this.jSONSchemas.add(builder);} return (A)this;
}
public A removeFromJSONSchemas(io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps... items) {
for (io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps item : items) {io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder builder = new io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder(item);_visitables.get("jSONSchemas").remove(builder);if (this.jSONSchemas != null) {this.jSONSchemas.remove(builder);}} return (A)this;
}
public A removeAllFromJSONSchemas(java.util.Collection items) {
for (io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps item : items) {io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder builder = new io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder(item);_visitables.get("jSONSchemas").remove(builder);if (this.jSONSchemas != null) {this.jSONSchemas.remove(builder);}} return (A)this;
}
public A removeMatchingFromJSONSchemas(java.util.function.Predicate predicate) {
if (jSONSchemas == null) return (A) this;
final Iterator each = jSONSchemas.iterator();
final List visitables = _visitables.get("jSONSchemas");
while (each.hasNext()) {
io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder builder = each.next();
if (predicate.test(builder)) {
visitables.remove(builder);
each.remove();
}
}
return (A)this;
}
/**
* This method has been deprecated, please use method buildJSONSchemas instead.
* @return The buildable object.
*/
@java.lang.Deprecated
public java.util.List getJSONSchemas() {
return build(jSONSchemas);
}
public java.util.List buildJSONSchemas() {
return build(jSONSchemas);
}
public io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps buildJSONSchema(java.lang.Integer index) {
return this.jSONSchemas.get(index).build();
}
public io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps buildFirstJSONSchema() {
return this.jSONSchemas.get(0).build();
}
public io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps buildLastJSONSchema() {
return this.jSONSchemas.get(jSONSchemas.size() - 1).build();
}
public io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps buildMatchingJSONSchema(java.util.function.Predicate predicate) {
for (io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder item: jSONSchemas) { if(predicate.test(item)){ return item.build();} } return null;
}
public java.lang.Boolean hasMatchingJSONSchema(java.util.function.Predicate predicate) {
for (io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder item: jSONSchemas) { if(predicate.test(item)){ return true;} } return false;
}
public A withJSONSchemas(java.util.List jSONSchemas) {
if (this.jSONSchemas != null) { _visitables.get("jSONSchemas").removeAll(this.jSONSchemas);}
if (jSONSchemas != null) {this.jSONSchemas = new java.util.ArrayList(); for (io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps item : jSONSchemas){this.addToJSONSchemas(item);}} else { this.jSONSchemas = null;} return (A) this;
}
public A withJSONSchemas(io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps... jSONSchemas) {
if (this.jSONSchemas != null) {this.jSONSchemas.clear();}
if (jSONSchemas != null) {for (io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps item :jSONSchemas){ this.addToJSONSchemas(item);}} return (A) this;
}
public java.lang.Boolean hasJSONSchemas() {
return jSONSchemas != null && !jSONSchemas.isEmpty();
}
public io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluent.JSONSchemasNested addNewJSONSchema() {
return new io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluentImpl.JSONSchemasNestedImpl();
}
public io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluent.JSONSchemasNested addNewJSONSchemaLike(io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps item) {
return new io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluentImpl.JSONSchemasNestedImpl(-1, item);
}
public io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluent.JSONSchemasNested setNewJSONSchemaLike(java.lang.Integer index,io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps item) {
return new io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluentImpl.JSONSchemasNestedImpl(index, item);
}
public io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluent.JSONSchemasNested editJSONSchema(java.lang.Integer index) {
if (jSONSchemas.size() <= index) throw new RuntimeException("Can't edit jSONSchemas. Index exceeds size.");
return setNewJSONSchemaLike(index, buildJSONSchema(index));
}
public io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluent.JSONSchemasNested editFirstJSONSchema() {
if (jSONSchemas.size() == 0) throw new RuntimeException("Can't edit first jSONSchemas. The list is empty.");
return setNewJSONSchemaLike(0, buildJSONSchema(0));
}
public io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluent.JSONSchemasNested editLastJSONSchema() {
int index = jSONSchemas.size() - 1;
if (index < 0) throw new RuntimeException("Can't edit last jSONSchemas. The list is empty.");
return setNewJSONSchemaLike(index, buildJSONSchema(index));
}
public io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluent.JSONSchemasNested editMatchingJSONSchema(java.util.function.Predicate predicate) {
int index = -1;
for (int i=0;i withNewSchema() {
return new io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluentImpl.SchemaNestedImpl();
}
public io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluent.SchemaNested withNewSchemaLike(io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps item) {
return new io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluentImpl.SchemaNestedImpl(item);
}
public io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluent.SchemaNested editSchema() {
return withNewSchemaLike(getSchema());
}
public io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluent.SchemaNested editOrNewSchema() {
return withNewSchemaLike(getSchema() != null ? getSchema(): new io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder().build());
}
public io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluent.SchemaNested editOrNewSchemaLike(io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps item) {
return withNewSchemaLike(getSchema() != null ? getSchema(): item);
}
public A addToAdditionalProperties(java.lang.String key,java.lang.Object value) {
if(this.additionalProperties == null && key != null && value != null) { this.additionalProperties = new java.util.LinkedHashMap(); }
if(key != null && value != null) {this.additionalProperties.put(key, value);} return (A)this;
}
public A addToAdditionalProperties(java.util.Map 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;
JSONSchemaPropsOrArrayFluentImpl that = (JSONSchemaPropsOrArrayFluentImpl) o;
if (jSONSchemas != null ? !jSONSchemas.equals(that.jSONSchemas) :that.jSONSchemas != null) return false;
if (schema != null ? !schema.equals(that.schema) :that.schema != 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(jSONSchemas, schema, additionalProperties, super.hashCode());
}
public class JSONSchemasNestedImpl extends io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsFluentImpl> implements io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluent.JSONSchemasNested,io.fabric8.kubernetes.api.builder.Nested{
JSONSchemasNestedImpl(java.lang.Integer index,io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps item) {
this.index = index;
this.builder = new io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder(this, item);
}
JSONSchemasNestedImpl() {
this.index = -1;
this.builder = new io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder(this);
}
io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder builder;
java.lang.Integer index;
public N and() {
return (N) JSONSchemaPropsOrArrayFluentImpl.this.setToJSONSchemas(index,builder.build());
}
public N endJSONSchema() {
return and();
}
}
public class SchemaNestedImpl extends io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsFluentImpl> implements io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsOrArrayFluent.SchemaNested,io.fabric8.kubernetes.api.builder.Nested{
SchemaNestedImpl(io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps item) {
this.builder = new io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder(this, item);
}
SchemaNestedImpl() {
this.builder = new io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder(this);
}
io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaPropsBuilder builder;
public N and() {
return (N) JSONSchemaPropsOrArrayFluentImpl.this.withSchema(builder.build());
}
public N endSchema() {
return and();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy