io.alauda.kubernetes.api.model.CodeRepositoryRefFluentImpl Maven / Gradle / Ivy
package io.alauda.kubernetes.api.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.alauda.kubernetes.api.builder.Nested;
import java.lang.String;
import java.lang.Deprecated;
import javax.validation.Valid;
import io.alauda.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;
public class CodeRepositoryRefFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements CodeRepositoryRefFluent{
private LocalObjectReferenceBuilder localObjectReference;
private String ref;
public CodeRepositoryRefFluentImpl(){
}
public CodeRepositoryRefFluentImpl(CodeRepositoryRef instance){
this.withLocalObjectReference(instance.getLocalObjectReference());
this.withRef(instance.getRef());
}
/**
* This method has been deprecated, please use method buildLocalObjectReference instead.
*/
@Deprecated public LocalObjectReference getLocalObjectReference(){
return this.localObjectReference!=null?this.localObjectReference.build():null;
}
public LocalObjectReference buildLocalObjectReference(){
return this.localObjectReference!=null?this.localObjectReference.build():null;
}
public A withLocalObjectReference(LocalObjectReference localObjectReference){
_visitables.remove(this.localObjectReference);
if (localObjectReference!=null){ this.localObjectReference= new LocalObjectReferenceBuilder(localObjectReference); _visitables.add(this.localObjectReference);} return (A) this;
}
public Boolean hasLocalObjectReference(){
return this.localObjectReference!=null;
}
public CodeRepositoryRefFluent.LocalObjectReferenceNested withNewLocalObjectReference(){
return new LocalObjectReferenceNestedImpl();
}
public CodeRepositoryRefFluent.LocalObjectReferenceNested withNewLocalObjectReferenceLike(LocalObjectReference item){
return new LocalObjectReferenceNestedImpl(item);
}
public CodeRepositoryRefFluent.LocalObjectReferenceNested editLocalObjectReference(){
return withNewLocalObjectReferenceLike(getLocalObjectReference());
}
public CodeRepositoryRefFluent.LocalObjectReferenceNested editOrNewLocalObjectReference(){
return withNewLocalObjectReferenceLike(getLocalObjectReference() != null ? getLocalObjectReference(): new LocalObjectReferenceBuilder().build());
}
public CodeRepositoryRefFluent.LocalObjectReferenceNested editOrNewLocalObjectReferenceLike(LocalObjectReference item){
return withNewLocalObjectReferenceLike(getLocalObjectReference() != null ? getLocalObjectReference(): item);
}
public A withNewLocalObjectReference(String name){
return (A)withLocalObjectReference(new LocalObjectReference(name));
}
public String getRef(){
return this.ref;
}
public A withRef(String ref){
this.ref=ref; return (A) this;
}
public Boolean hasRef(){
return this.ref!=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;
CodeRepositoryRefFluentImpl that = (CodeRepositoryRefFluentImpl) o;
if (localObjectReference != null ? !localObjectReference.equals(that.localObjectReference) :that.localObjectReference != null) return false;
if (ref != null ? !ref.equals(that.ref) :that.ref != null) return false;
return true;
}
public class LocalObjectReferenceNestedImpl extends LocalObjectReferenceFluentImpl> implements CodeRepositoryRefFluent.LocalObjectReferenceNested,io.alauda.kubernetes.api.builder.Nested{
private final LocalObjectReferenceBuilder builder;
LocalObjectReferenceNestedImpl(LocalObjectReference item){
this.builder = new LocalObjectReferenceBuilder(this, item);
}
LocalObjectReferenceNestedImpl(){
this.builder = new LocalObjectReferenceBuilder(this);
}
public N and(){
return (N) CodeRepositoryRefFluentImpl.this.withLocalObjectReference(builder.build());
}
public N endLocalObjectReference(){
return and();
}
}
}