All Downloads are FREE. Search and download functionalities are using the official Maven repository.

annotations.io.alauda.devops.api.model.ClusterPolicyBuilder Maven / Gradle / Ivy

There is a newer version: 0.2.12
Show newest version
package io.alauda.devops.api.model;

import io.alauda.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;

public class ClusterPolicyBuilder extends ClusterPolicyFluentImpl implements VisitableBuilder{

    ClusterPolicyFluent fluent;
    Boolean validationEnabled;

    public ClusterPolicyBuilder(){
            this(true);
    }
    public ClusterPolicyBuilder(Boolean validationEnabled){
            this(new ClusterPolicy(), validationEnabled);
    }
    public ClusterPolicyBuilder(ClusterPolicyFluent fluent){
            this(fluent, true);
    }
    public ClusterPolicyBuilder(ClusterPolicyFluent fluent,Boolean validationEnabled){
            this(fluent, new ClusterPolicy(), validationEnabled);
    }
    public ClusterPolicyBuilder(ClusterPolicyFluent fluent,ClusterPolicy instance){
            this(fluent, instance, true);
    }
    public ClusterPolicyBuilder(ClusterPolicyFluent fluent,ClusterPolicy instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withApiVersion(instance.getApiVersion()); 
            fluent.withKind(instance.getKind()); 
            fluent.withLastModified(instance.getLastModified()); 
            fluent.withMetadata(instance.getMetadata()); 
            fluent.withRoles(instance.getRoles()); 
            this.validationEnabled = validationEnabled; 
    }
    public ClusterPolicyBuilder(ClusterPolicy instance){
            this(instance,true);
    }
    public ClusterPolicyBuilder(ClusterPolicy instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withApiVersion(instance.getApiVersion()); 
            this.withKind(instance.getKind()); 
            this.withLastModified(instance.getLastModified()); 
            this.withMetadata(instance.getMetadata()); 
            this.withRoles(instance.getRoles()); 
            this.validationEnabled = validationEnabled; 
    }

    public ClusterPolicy build(){
            ClusterPolicy buildable = new ClusterPolicy(fluent.getApiVersion(),fluent.getKind(),fluent.getLastModified(),fluent.getMetadata(),fluent.getRoles());
            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;
            ClusterPolicyBuilder that = (ClusterPolicyBuilder) 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;
    }




}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy