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

me.snowdrop.istio.api.StatusBuilder Maven / Gradle / Ivy

There is a newer version: 1.7.7.1
Show newest version
package me.snowdrop.istio.api;

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

public class StatusBuilder extends StatusFluentImpl implements VisitableBuilder{

    StatusFluent fluent;
    Boolean validationEnabled;

    public StatusBuilder(){
            this(true);
    }
    public StatusBuilder(Boolean validationEnabled){
            this(new Status(), validationEnabled);
    }
    public StatusBuilder(StatusFluent fluent){
            this(fluent, true);
    }
    public StatusBuilder(StatusFluent fluent,Boolean validationEnabled){
            this(fluent, new Status(), validationEnabled);
    }
    public StatusBuilder(StatusFluent fluent,Status instance){
            this(fluent, instance, true);
    }
    public StatusBuilder(StatusFluent fluent,Status instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withCode(instance.getCode()); 
            fluent.withDetails(instance.getDetails()); 
            fluent.withMessage(instance.getMessage()); 
            this.validationEnabled = validationEnabled; 
    }
    public StatusBuilder(Status instance){
            this(instance,true);
    }
    public StatusBuilder(Status instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withCode(instance.getCode()); 
            this.withDetails(instance.getDetails()); 
            this.withMessage(instance.getMessage()); 
            this.validationEnabled = validationEnabled; 
    }

    public Status build(){
            Status buildable = new Status(fluent.getCode(),fluent.getDetails(),fluent.getMessage());
            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;
            StatusBuilder that = (StatusBuilder) 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