annotations.io.alauda.kubernetes.api.model.CodeRepositoryOwnerSyncFluentImpl Maven / Gradle / Ivy
package io.alauda.kubernetes.api.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.lang.String;
import io.alauda.kubernetes.api.builder.Predicate;
import javax.validation.Valid;
import io.alauda.kubernetes.api.builder.BaseFluent;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.lang.Boolean;
public class CodeRepositoryOwnerSyncFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements CodeRepositoryOwnerSyncFluent{
private Boolean all;
private String name;
private List repositories = new ArrayList();
private String type;
public CodeRepositoryOwnerSyncFluentImpl(){
}
public CodeRepositoryOwnerSyncFluentImpl(CodeRepositoryOwnerSync instance){
this.withAll(instance.getAll());
this.withName(instance.getName());
this.withRepositories(instance.getRepositories());
this.withType(instance.getType());
}
public Boolean isAll(){
return this.all;
}
public A withAll(Boolean all){
this.all=all; return (A) this;
}
public Boolean hasAll(){
return this.all!=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 A addToRepositories(int index,String item){
this.repositories.add(index, item); return (A)this;
}
public A setToRepositories(int index,String item){
this.repositories.set(index, item); return (A)this;
}
public A addToRepositories(String... items){
for (String item : items) {this.repositories.add(item);} return (A)this;
}
public A addAllToRepositories(Collection items){
for (String item : items) {this.repositories.add(item);} return (A)this;
}
public A removeFromRepositories(String... items){
for (String item : items) {this.repositories.remove(item);} return (A)this;
}
public A removeAllFromRepositories(Collection items){
for (String item : items) {this.repositories.remove(item);} return (A)this;
}
public List getRepositories(){
return this.repositories;
}
public String getRepository(int index){
return this.repositories.get(index);
}
public String getFirstRepository(){
return this.repositories.get(0);
}
public String getLastRepository(){
return this.repositories.get(repositories.size() - 1);
}
public String getMatchingRepository(io.alauda.kubernetes.api.builder.Predicate predicate){
for (String item: repositories) { if(predicate.apply(item)){return item;} } return null;
}
public A withRepositories(List repositories){
this.repositories.clear();
if (repositories != null) {for (String item : repositories){this.addToRepositories(item);}} return (A) this;
}
public A withRepositories(String... repositories){
this.repositories.clear(); if (repositories != null) {for (String item :repositories){ this.addToRepositories(item);}} return (A) this;
}
public Boolean hasRepositories(){
return repositories!= null && !repositories.isEmpty();
}
public String getType(){
return this.type;
}
public A withType(String type){
this.type=type; return (A) this;
}
public Boolean hasType(){
return this.type!=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;
CodeRepositoryOwnerSyncFluentImpl that = (CodeRepositoryOwnerSyncFluentImpl) o;
if (all != null ? !all.equals(that.all) :that.all != null) return false;
if (name != null ? !name.equals(that.name) :that.name != null) return false;
if (repositories != null ? !repositories.equals(that.repositories) :that.repositories != null) return false;
if (type != null ? !type.equals(that.type) :that.type != null) return false;
return true;
}
}