io.alauda.kubernetes.api.model.CodeRepositoryStatusRepositoryFluentImpl 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 CodeRepositoryStatusRepositoryFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements CodeRepositoryStatusRepositoryFluent{
private RepositoryCommitBuilder latestCommit;
public CodeRepositoryStatusRepositoryFluentImpl(){
}
public CodeRepositoryStatusRepositoryFluentImpl(CodeRepositoryStatusRepository instance){
this.withLatestCommit(instance.getLatestCommit());
}
/**
* This method has been deprecated, please use method buildLatestCommit instead.
*/
@Deprecated public RepositoryCommit getLatestCommit(){
return this.latestCommit!=null?this.latestCommit.build():null;
}
public RepositoryCommit buildLatestCommit(){
return this.latestCommit!=null?this.latestCommit.build():null;
}
public A withLatestCommit(RepositoryCommit latestCommit){
_visitables.remove(this.latestCommit);
if (latestCommit!=null){ this.latestCommit= new RepositoryCommitBuilder(latestCommit); _visitables.add(this.latestCommit);} return (A) this;
}
public Boolean hasLatestCommit(){
return this.latestCommit!=null;
}
public CodeRepositoryStatusRepositoryFluent.LatestCommitNested withNewLatestCommit(){
return new LatestCommitNestedImpl();
}
public CodeRepositoryStatusRepositoryFluent.LatestCommitNested withNewLatestCommitLike(RepositoryCommit item){
return new LatestCommitNestedImpl(item);
}
public CodeRepositoryStatusRepositoryFluent.LatestCommitNested editLatestCommit(){
return withNewLatestCommitLike(getLatestCommit());
}
public CodeRepositoryStatusRepositoryFluent.LatestCommitNested editOrNewLatestCommit(){
return withNewLatestCommitLike(getLatestCommit() != null ? getLatestCommit(): new RepositoryCommitBuilder().build());
}
public CodeRepositoryStatusRepositoryFluent.LatestCommitNested editOrNewLatestCommitLike(RepositoryCommit item){
return withNewLatestCommitLike(getLatestCommit() != null ? getLatestCommit(): item);
}
public A withNewLatestCommit(String commitAt,String commitID,String commitMessage,String committerEmail,String committerName){
return (A)withLatestCommit(new RepositoryCommit(commitAt, commitID, commitMessage, committerEmail, committerName));
}
public boolean equals(Object o){
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CodeRepositoryStatusRepositoryFluentImpl that = (CodeRepositoryStatusRepositoryFluentImpl) o;
if (latestCommit != null ? !latestCommit.equals(that.latestCommit) :that.latestCommit != null) return false;
return true;
}
public class LatestCommitNestedImpl extends RepositoryCommitFluentImpl> implements CodeRepositoryStatusRepositoryFluent.LatestCommitNested,io.alauda.kubernetes.api.builder.Nested{
private final RepositoryCommitBuilder builder;
LatestCommitNestedImpl(RepositoryCommit item){
this.builder = new RepositoryCommitBuilder(this, item);
}
LatestCommitNestedImpl(){
this.builder = new RepositoryCommitBuilder(this);
}
public N and(){
return (N) CodeRepositoryStatusRepositoryFluentImpl.this.withLatestCommit(builder.build());
}
public N endLatestCommit(){
return and();
}
}
}