Package org.ldaptive
Class AbstractConnectionValidator.AbstractBuilder<B,T extends AbstractConnectionValidator>
- java.lang.Object
-
- org.ldaptive.AbstractConnectionValidator.AbstractBuilder<B,T>
-
- Type Parameters:
B
- type of builderT
- type of validator
- Direct Known Subclasses:
AbstractOperationConnectionValidator.AbstractBuilder
- Enclosing class:
- AbstractConnectionValidator
protected abstract static class AbstractConnectionValidator.AbstractBuilder<B,T extends AbstractConnectionValidator> extends Object
Base class for validator builders.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBuilder(T t)
Creates a new abstract builder.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
build()
Returns the connection validator.B
onFailure(Consumer<Connection> consumer)
B
onSuccess(Consumer<Connection> consumer)
B
period(Duration period)
Sets the validation period.protected abstract B
self()
Returns this builder.B
timeout(Duration timeout)
Sets the validation timeout.B
timeoutIsFailure(boolean failure)
Sets whether timeout is a validation failure.
-
-
-
Field Detail
-
object
protected final T extends AbstractConnectionValidator object
Validator to build.
-
-
Constructor Detail
-
AbstractBuilder
protected AbstractBuilder(T t)
Creates a new abstract builder.- Parameters:
t
- validator to build
-
-
Method Detail
-
self
protected abstract B self()
Returns this builder.- Returns:
- builder
-
period
public B period(Duration period)
Sets the validation period.- Parameters:
period
- to set- Returns:
- this builder
-
timeout
public B timeout(Duration timeout)
Sets the validation timeout.- Parameters:
timeout
- to set- Returns:
- this builder
-
onSuccess
public B onSuccess(Consumer<Connection> consumer)
-
onFailure
public B onFailure(Consumer<Connection> consumer)
-
timeoutIsFailure
public B timeoutIsFailure(boolean failure)
Sets whether timeout is a validation failure.- Parameters:
failure
- whether timeout is a validation failure- Returns:
- this builder
-
build
public T build()
Returns the connection validator.- Returns:
- connection validator
-
-