me.snowdrop.istio.mixer.adapter.stdio.StdioBuilder Maven / Gradle / Ivy
The newest version!
package me.snowdrop.istio.mixer.adapter.stdio;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
public class StdioBuilder extends StdioFluentImpl implements VisitableBuilder{
StdioFluent fluent;
Boolean validationEnabled;
public StdioBuilder(){
this(true);
}
public StdioBuilder(Boolean validationEnabled){
this(new Stdio(), validationEnabled);
}
public StdioBuilder(StdioFluent fluent){
this(fluent, true);
}
public StdioBuilder(StdioFluent fluent,Boolean validationEnabled){
this(fluent, new Stdio(), validationEnabled);
}
public StdioBuilder(StdioFluent fluent,Stdio instance){
this(fluent, instance, true);
}
public StdioBuilder(StdioFluent fluent,Stdio instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withLogStream(instance.getLogStream());
fluent.withMaxDaysBeforeRotation(instance.getMaxDaysBeforeRotation());
fluent.withMaxMegabytesBeforeRotation(instance.getMaxMegabytesBeforeRotation());
fluent.withMaxRotatedFiles(instance.getMaxRotatedFiles());
fluent.withMetricLevel(instance.getMetricLevel());
fluent.withOutputAsJson(instance.getOutputAsJson());
fluent.withOutputLevel(instance.getOutputLevel());
fluent.withOutputPath(instance.getOutputPath());
fluent.withSeverityLevels(instance.getSeverityLevels());
this.validationEnabled = validationEnabled;
}
public StdioBuilder(Stdio instance){
this(instance,true);
}
public StdioBuilder(Stdio instance,Boolean validationEnabled){
this.fluent = this;
this.withLogStream(instance.getLogStream());
this.withMaxDaysBeforeRotation(instance.getMaxDaysBeforeRotation());
this.withMaxMegabytesBeforeRotation(instance.getMaxMegabytesBeforeRotation());
this.withMaxRotatedFiles(instance.getMaxRotatedFiles());
this.withMetricLevel(instance.getMetricLevel());
this.withOutputAsJson(instance.getOutputAsJson());
this.withOutputLevel(instance.getOutputLevel());
this.withOutputPath(instance.getOutputPath());
this.withSeverityLevels(instance.getSeverityLevels());
this.validationEnabled = validationEnabled;
}
public Stdio build(){
Stdio buildable = new Stdio(fluent.getLogStream(),fluent.getMaxDaysBeforeRotation(),fluent.getMaxMegabytesBeforeRotation(),fluent.getMaxRotatedFiles(),fluent.getMetricLevel(),fluent.isOutputAsJson(),fluent.getOutputLevel(),fluent.getOutputPath(),fluent.getSeverityLevels());
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;
StdioBuilder that = (StdioBuilder) 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;
}
}