io.alauda.devops.api.model.GitSourceRevisionFluentImpl Maven / Gradle / Ivy
package io.alauda.devops.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 GitSourceRevisionFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements GitSourceRevisionFluent{
private SourceControlUserBuilder author;
private String commit;
private SourceControlUserBuilder committer;
private String message;
public GitSourceRevisionFluentImpl(){
}
public GitSourceRevisionFluentImpl(GitSourceRevision instance){
this.withAuthor(instance.getAuthor());
this.withCommit(instance.getCommit());
this.withCommitter(instance.getCommitter());
this.withMessage(instance.getMessage());
}
/**
* This method has been deprecated, please use method buildAuthor instead.
*/
@Deprecated public SourceControlUser getAuthor(){
return this.author!=null?this.author.build():null;
}
public SourceControlUser buildAuthor(){
return this.author!=null?this.author.build():null;
}
public A withAuthor(SourceControlUser author){
_visitables.remove(this.author);
if (author!=null){ this.author= new SourceControlUserBuilder(author); _visitables.add(this.author);} return (A) this;
}
public Boolean hasAuthor(){
return this.author!=null;
}
public GitSourceRevisionFluent.AuthorNested withNewAuthor(){
return new AuthorNestedImpl();
}
public GitSourceRevisionFluent.AuthorNested withNewAuthorLike(SourceControlUser item){
return new AuthorNestedImpl(item);
}
public GitSourceRevisionFluent.AuthorNested editAuthor(){
return withNewAuthorLike(getAuthor());
}
public GitSourceRevisionFluent.AuthorNested editOrNewAuthor(){
return withNewAuthorLike(getAuthor() != null ? getAuthor(): new SourceControlUserBuilder().build());
}
public GitSourceRevisionFluent.AuthorNested editOrNewAuthorLike(SourceControlUser item){
return withNewAuthorLike(getAuthor() != null ? getAuthor(): item);
}
public A withNewAuthor(String email,String name){
return (A)withAuthor(new SourceControlUser(email, name));
}
public String getCommit(){
return this.commit;
}
public A withCommit(String commit){
this.commit=commit; return (A) this;
}
public Boolean hasCommit(){
return this.commit!=null;
}
/**
* This method has been deprecated, please use method buildCommitter instead.
*/
@Deprecated public SourceControlUser getCommitter(){
return this.committer!=null?this.committer.build():null;
}
public SourceControlUser buildCommitter(){
return this.committer!=null?this.committer.build():null;
}
public A withCommitter(SourceControlUser committer){
_visitables.remove(this.committer);
if (committer!=null){ this.committer= new SourceControlUserBuilder(committer); _visitables.add(this.committer);} return (A) this;
}
public Boolean hasCommitter(){
return this.committer!=null;
}
public GitSourceRevisionFluent.CommitterNested withNewCommitter(){
return new CommitterNestedImpl();
}
public GitSourceRevisionFluent.CommitterNested withNewCommitterLike(SourceControlUser item){
return new CommitterNestedImpl(item);
}
public GitSourceRevisionFluent.CommitterNested editCommitter(){
return withNewCommitterLike(getCommitter());
}
public GitSourceRevisionFluent.CommitterNested editOrNewCommitter(){
return withNewCommitterLike(getCommitter() != null ? getCommitter(): new SourceControlUserBuilder().build());
}
public GitSourceRevisionFluent.CommitterNested editOrNewCommitterLike(SourceControlUser item){
return withNewCommitterLike(getCommitter() != null ? getCommitter(): item);
}
public A withNewCommitter(String email,String name){
return (A)withCommitter(new SourceControlUser(email, name));
}
public String getMessage(){
return this.message;
}
public A withMessage(String message){
this.message=message; return (A) this;
}
public Boolean hasMessage(){
return this.message!=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;
GitSourceRevisionFluentImpl that = (GitSourceRevisionFluentImpl) o;
if (author != null ? !author.equals(that.author) :that.author != null) return false;
if (commit != null ? !commit.equals(that.commit) :that.commit != null) return false;
if (committer != null ? !committer.equals(that.committer) :that.committer != null) return false;
if (message != null ? !message.equals(that.message) :that.message != null) return false;
return true;
}
public class AuthorNestedImpl extends SourceControlUserFluentImpl> implements GitSourceRevisionFluent.AuthorNested,io.alauda.kubernetes.api.builder.Nested{
private final SourceControlUserBuilder builder;
AuthorNestedImpl(SourceControlUser item){
this.builder = new SourceControlUserBuilder(this, item);
}
AuthorNestedImpl(){
this.builder = new SourceControlUserBuilder(this);
}
public N and(){
return (N) GitSourceRevisionFluentImpl.this.withAuthor(builder.build());
}
public N endAuthor(){
return and();
}
}
public class CommitterNestedImpl extends SourceControlUserFluentImpl> implements GitSourceRevisionFluent.CommitterNested,io.alauda.kubernetes.api.builder.Nested{
private final SourceControlUserBuilder builder;
CommitterNestedImpl(SourceControlUser item){
this.builder = new SourceControlUserBuilder(this, item);
}
CommitterNestedImpl(){
this.builder = new SourceControlUserBuilder(this);
}
public N and(){
return (N) GitSourceRevisionFluentImpl.this.withCommitter(builder.build());
}
public N endCommitter(){
return and();
}
}
}