io.alauda.devops.api.model.OAuthAccessTokenBuilder Maven / Gradle / Ivy
package io.alauda.devops.api.model;
import io.alauda.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
public class OAuthAccessTokenBuilder extends OAuthAccessTokenFluentImpl implements VisitableBuilder{
OAuthAccessTokenFluent> fluent;
Boolean validationEnabled;
public OAuthAccessTokenBuilder(){
this(true);
}
public OAuthAccessTokenBuilder(Boolean validationEnabled){
this(new OAuthAccessToken(), validationEnabled);
}
public OAuthAccessTokenBuilder(OAuthAccessTokenFluent> fluent){
this(fluent, true);
}
public OAuthAccessTokenBuilder(OAuthAccessTokenFluent> fluent,Boolean validationEnabled){
this(fluent, new OAuthAccessToken(), validationEnabled);
}
public OAuthAccessTokenBuilder(OAuthAccessTokenFluent> fluent,OAuthAccessToken instance){
this(fluent, instance, true);
}
public OAuthAccessTokenBuilder(OAuthAccessTokenFluent> fluent,OAuthAccessToken instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withApiVersion(instance.getApiVersion());
fluent.withAuthorizeToken(instance.getAuthorizeToken());
fluent.withClientName(instance.getClientName());
fluent.withExpiresIn(instance.getExpiresIn());
fluent.withKind(instance.getKind());
fluent.withMetadata(instance.getMetadata());
fluent.withRedirectURI(instance.getRedirectURI());
fluent.withRefreshToken(instance.getRefreshToken());
fluent.withScopes(instance.getScopes());
fluent.withUserName(instance.getUserName());
fluent.withUserUID(instance.getUserUID());
this.validationEnabled = validationEnabled;
}
public OAuthAccessTokenBuilder(OAuthAccessToken instance){
this(instance,true);
}
public OAuthAccessTokenBuilder(OAuthAccessToken instance,Boolean validationEnabled){
this.fluent = this;
this.withApiVersion(instance.getApiVersion());
this.withAuthorizeToken(instance.getAuthorizeToken());
this.withClientName(instance.getClientName());
this.withExpiresIn(instance.getExpiresIn());
this.withKind(instance.getKind());
this.withMetadata(instance.getMetadata());
this.withRedirectURI(instance.getRedirectURI());
this.withRefreshToken(instance.getRefreshToken());
this.withScopes(instance.getScopes());
this.withUserName(instance.getUserName());
this.withUserUID(instance.getUserUID());
this.validationEnabled = validationEnabled;
}
public OAuthAccessToken build(){
OAuthAccessToken buildable = new OAuthAccessToken(fluent.getApiVersion(),fluent.getAuthorizeToken(),fluent.getClientName(),fluent.getExpiresIn(),fluent.getKind(),fluent.getMetadata(),fluent.getRedirectURI(),fluent.getRefreshToken(),fluent.getScopes(),fluent.getUserName(),fluent.getUserUID());
io.alauda.kubernetes.api.builder.ValidationUtils.validate(buildable);
return buildable;
}
public boolean equals(Object o){
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
OAuthAccessTokenBuilder that = (OAuthAccessTokenBuilder) o;
if (fluent != null &&fluent != this ? !fluent.equals(that.fluent) :that.fluent != null &&fluent != this ) return false;
if (validationEnabled != null ? !validationEnabled.equals(that.validationEnabled) :that.validationEnabled != null) return false;
return true;
}
}