annotations.io.alauda.kubernetes.api.model.EndpointAddressBuilder Maven / Gradle / Ivy
package io.alauda.kubernetes.api.model;
import io.alauda.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
public class EndpointAddressBuilder extends EndpointAddressFluentImpl implements VisitableBuilder{
EndpointAddressFluent> fluent;
Boolean validationEnabled;
public EndpointAddressBuilder(){
this(true);
}
public EndpointAddressBuilder(Boolean validationEnabled){
this(new EndpointAddress(), validationEnabled);
}
public EndpointAddressBuilder(EndpointAddressFluent> fluent){
this(fluent, true);
}
public EndpointAddressBuilder(EndpointAddressFluent> fluent,Boolean validationEnabled){
this(fluent, new EndpointAddress(), validationEnabled);
}
public EndpointAddressBuilder(EndpointAddressFluent> fluent,EndpointAddress instance){
this(fluent, instance, true);
}
public EndpointAddressBuilder(EndpointAddressFluent> fluent,EndpointAddress instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withHostname(instance.getHostname());
fluent.withIp(instance.getIp());
fluent.withNodeName(instance.getNodeName());
fluent.withTargetRef(instance.getTargetRef());
this.validationEnabled = validationEnabled;
}
public EndpointAddressBuilder(EndpointAddress instance){
this(instance,true);
}
public EndpointAddressBuilder(EndpointAddress instance,Boolean validationEnabled){
this.fluent = this;
this.withHostname(instance.getHostname());
this.withIp(instance.getIp());
this.withNodeName(instance.getNodeName());
this.withTargetRef(instance.getTargetRef());
this.validationEnabled = validationEnabled;
}
public EndpointAddress build(){
EndpointAddress buildable = new EndpointAddress(fluent.getHostname(),fluent.getIp(),fluent.getNodeName(),fluent.getTargetRef());
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;
EndpointAddressBuilder that = (EndpointAddressBuilder) 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;
}
}