annotations.io.alauda.kubernetes.api.model.PipelineTemplateArgumentFluentImpl Maven / Gradle / Ivy
package io.alauda.kubernetes.api.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.alauda.kubernetes.api.builder.Nested;
import java.util.ArrayList;
import java.lang.String;
import io.alauda.kubernetes.api.builder.Predicate;
import java.lang.Deprecated;
import io.alauda.kubernetes.api.builder.BaseFluent;
import java.util.List;
import java.lang.Boolean;
import javax.validation.Valid;
import java.util.Collection;
import java.lang.Object;
public class PipelineTemplateArgumentFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements PipelineTemplateArgumentFluent{
private List binding = new ArrayList();
private String _default;
private PipelineTaskArgumentDisplayBuilder display;
private String name;
private Boolean required;
private PipelineTaskArgumentSchemaBuilder schema;
private PipelineTaskArgumentValidationBuilder validation;
public PipelineTemplateArgumentFluentImpl(){
}
public PipelineTemplateArgumentFluentImpl(PipelineTemplateArgument instance){
this.withBinding(instance.getBinding());
this.withDefault(instance.getDefault());
this.withDisplay(instance.getDisplay());
this.withName(instance.getName());
this.withRequired(instance.getRequired());
this.withSchema(instance.getSchema());
this.withValidation(instance.getValidation());
}
public A addToBinding(int index,String item){
this.binding.add(index, item); return (A)this;
}
public A setToBinding(int index,String item){
this.binding.set(index, item); return (A)this;
}
public A addToBinding(String... items){
for (String item : items) {this.binding.add(item);} return (A)this;
}
public A addAllToBinding(Collection items){
for (String item : items) {this.binding.add(item);} return (A)this;
}
public A removeFromBinding(String... items){
for (String item : items) {this.binding.remove(item);} return (A)this;
}
public A removeAllFromBinding(Collection items){
for (String item : items) {this.binding.remove(item);} return (A)this;
}
public List getBinding(){
return this.binding;
}
public String getBinding(int index){
return this.binding.get(index);
}
public String getFirstBinding(){
return this.binding.get(0);
}
public String getLastBinding(){
return this.binding.get(binding.size() - 1);
}
public String getMatchingBinding(io.alauda.kubernetes.api.builder.Predicate predicate){
for (String item: binding) { if(predicate.apply(item)){return item;} } return null;
}
public A withBinding(List binding){
this.binding.clear();
if (binding != null) {for (String item : binding){this.addToBinding(item);}} return (A) this;
}
public A withBinding(String... binding){
this.binding.clear(); if (binding != null) {for (String item :binding){ this.addToBinding(item);}} return (A) this;
}
public Boolean hasBinding(){
return binding!= null && !binding.isEmpty();
}
public String getDefault(){
return this._default;
}
public A withDefault(String _default){
this._default=_default; return (A) this;
}
public Boolean hasDefault(){
return this._default!=null;
}
/**
* This method has been deprecated, please use method buildDisplay instead.
*/
@Deprecated public PipelineTaskArgumentDisplay getDisplay(){
return this.display!=null?this.display.build():null;
}
public PipelineTaskArgumentDisplay buildDisplay(){
return this.display!=null?this.display.build():null;
}
public A withDisplay(PipelineTaskArgumentDisplay display){
_visitables.remove(this.display);
if (display!=null){ this.display= new PipelineTaskArgumentDisplayBuilder(display); _visitables.add(this.display);} return (A) this;
}
public Boolean hasDisplay(){
return this.display!=null;
}
public PipelineTemplateArgumentFluent.DisplayNested withNewDisplay(){
return new DisplayNestedImpl();
}
public PipelineTemplateArgumentFluent.DisplayNested withNewDisplayLike(PipelineTaskArgumentDisplay item){
return new DisplayNestedImpl(item);
}
public PipelineTemplateArgumentFluent.DisplayNested editDisplay(){
return withNewDisplayLike(getDisplay());
}
public PipelineTemplateArgumentFluent.DisplayNested editOrNewDisplay(){
return withNewDisplayLike(getDisplay() != null ? getDisplay(): new PipelineTaskArgumentDisplayBuilder().build());
}
public PipelineTemplateArgumentFluent.DisplayNested editOrNewDisplayLike(PipelineTaskArgumentDisplay item){
return withNewDisplayLike(getDisplay() != null ? getDisplay(): item);
}
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 Boolean isRequired(){
return this.required;
}
public A withRequired(Boolean required){
this.required=required; return (A) this;
}
public Boolean hasRequired(){
return this.required!=null;
}
/**
* This method has been deprecated, please use method buildSchema instead.
*/
@Deprecated public PipelineTaskArgumentSchema getSchema(){
return this.schema!=null?this.schema.build():null;
}
public PipelineTaskArgumentSchema buildSchema(){
return this.schema!=null?this.schema.build():null;
}
public A withSchema(PipelineTaskArgumentSchema schema){
_visitables.remove(this.schema);
if (schema!=null){ this.schema= new PipelineTaskArgumentSchemaBuilder(schema); _visitables.add(this.schema);} return (A) this;
}
public Boolean hasSchema(){
return this.schema!=null;
}
public PipelineTemplateArgumentFluent.SchemaNested withNewSchema(){
return new SchemaNestedImpl();
}
public PipelineTemplateArgumentFluent.SchemaNested withNewSchemaLike(PipelineTaskArgumentSchema item){
return new SchemaNestedImpl(item);
}
public PipelineTemplateArgumentFluent.SchemaNested editSchema(){
return withNewSchemaLike(getSchema());
}
public PipelineTemplateArgumentFluent.SchemaNested editOrNewSchema(){
return withNewSchemaLike(getSchema() != null ? getSchema(): new PipelineTaskArgumentSchemaBuilder().build());
}
public PipelineTemplateArgumentFluent.SchemaNested editOrNewSchemaLike(PipelineTaskArgumentSchema item){
return withNewSchemaLike(getSchema() != null ? getSchema(): item);
}
public A withNewSchema(String type){
return (A)withSchema(new PipelineTaskArgumentSchema(type));
}
/**
* This method has been deprecated, please use method buildValidation instead.
*/
@Deprecated public PipelineTaskArgumentValidation getValidation(){
return this.validation!=null?this.validation.build():null;
}
public PipelineTaskArgumentValidation buildValidation(){
return this.validation!=null?this.validation.build():null;
}
public A withValidation(PipelineTaskArgumentValidation validation){
_visitables.remove(this.validation);
if (validation!=null){ this.validation= new PipelineTaskArgumentValidationBuilder(validation); _visitables.add(this.validation);} return (A) this;
}
public Boolean hasValidation(){
return this.validation!=null;
}
public PipelineTemplateArgumentFluent.ValidationNested withNewValidation(){
return new ValidationNestedImpl();
}
public PipelineTemplateArgumentFluent.ValidationNested withNewValidationLike(PipelineTaskArgumentValidation item){
return new ValidationNestedImpl(item);
}
public PipelineTemplateArgumentFluent.ValidationNested editValidation(){
return withNewValidationLike(getValidation());
}
public PipelineTemplateArgumentFluent.ValidationNested editOrNewValidation(){
return withNewValidationLike(getValidation() != null ? getValidation(): new PipelineTaskArgumentValidationBuilder().build());
}
public PipelineTemplateArgumentFluent.ValidationNested editOrNewValidationLike(PipelineTaskArgumentValidation item){
return withNewValidationLike(getValidation() != null ? getValidation(): item);
}
public A withNewValidation(String pattern){
return (A)withValidation(new PipelineTaskArgumentValidation(pattern));
}
public boolean equals(Object o){
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
PipelineTemplateArgumentFluentImpl that = (PipelineTemplateArgumentFluentImpl) o;
if (binding != null ? !binding.equals(that.binding) :that.binding != null) return false;
if (_default != null ? !_default.equals(that._default) :that._default != null) return false;
if (display != null ? !display.equals(that.display) :that.display != null) return false;
if (name != null ? !name.equals(that.name) :that.name != null) return false;
if (required != null ? !required.equals(that.required) :that.required != null) return false;
if (schema != null ? !schema.equals(that.schema) :that.schema != null) return false;
if (validation != null ? !validation.equals(that.validation) :that.validation != null) return false;
return true;
}
public class DisplayNestedImpl extends PipelineTaskArgumentDisplayFluentImpl> implements PipelineTemplateArgumentFluent.DisplayNested,io.alauda.kubernetes.api.builder.Nested{
private final PipelineTaskArgumentDisplayBuilder builder;
DisplayNestedImpl(PipelineTaskArgumentDisplay item){
this.builder = new PipelineTaskArgumentDisplayBuilder(this, item);
}
DisplayNestedImpl(){
this.builder = new PipelineTaskArgumentDisplayBuilder(this);
}
public N and(){
return (N) PipelineTemplateArgumentFluentImpl.this.withDisplay(builder.build());
}
public N endDisplay(){
return and();
}
}
public class SchemaNestedImpl extends PipelineTaskArgumentSchemaFluentImpl> implements PipelineTemplateArgumentFluent.SchemaNested,io.alauda.kubernetes.api.builder.Nested{
private final PipelineTaskArgumentSchemaBuilder builder;
SchemaNestedImpl(PipelineTaskArgumentSchema item){
this.builder = new PipelineTaskArgumentSchemaBuilder(this, item);
}
SchemaNestedImpl(){
this.builder = new PipelineTaskArgumentSchemaBuilder(this);
}
public N and(){
return (N) PipelineTemplateArgumentFluentImpl.this.withSchema(builder.build());
}
public N endSchema(){
return and();
}
}
public class ValidationNestedImpl extends PipelineTaskArgumentValidationFluentImpl> implements PipelineTemplateArgumentFluent.ValidationNested,io.alauda.kubernetes.api.builder.Nested{
private final PipelineTaskArgumentValidationBuilder builder;
ValidationNestedImpl(PipelineTaskArgumentValidation item){
this.builder = new PipelineTaskArgumentValidationBuilder(this, item);
}
ValidationNestedImpl(){
this.builder = new PipelineTaskArgumentValidationBuilder(this);
}
public N and(){
return (N) PipelineTemplateArgumentFluentImpl.this.withValidation(builder.build());
}
public N endValidation(){
return and();
}
}
}