Class ClassValidator<T>
- java.lang.Object
-
- org.apache.bookkeeper.common.conf.validators.ClassValidator<T>
-
-
Constructor Summary
Constructors Constructor Description ClassValidator(java.lang.Class<T> interfaceClass)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(java.lang.Object other)
java.lang.String
documentation()
Return the documentation for a given validator.boolean
equals(java.lang.Object o)
java.lang.Class<T>
getInterfaceClass()
int
hashCode()
static <T> ClassValidator<T>
of(java.lang.Class<T> interfaceClass)
Create a validator to validate if a setting is returning a class that extends from interfaceClass.java.lang.String
toString()
boolean
validate(java.lang.String name, java.lang.Object value)
Validates the configuration value.
-
-
-
Constructor Detail
-
ClassValidator
public ClassValidator(java.lang.Class<T> interfaceClass)
-
-
Method Detail
-
of
public static <T> ClassValidator<T> of(java.lang.Class<T> interfaceClass)
Create a validator to validate if a setting is returning a class that extends from interfaceClass.- Parameters:
interfaceClass
- interface class- Returns:
- the validator that expects a setting return a class that extends from interfaceClass
-
validate
public boolean validate(java.lang.String name, java.lang.Object value)
Description copied from interface:Validator
Validates the configuration value.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
documentation
public java.lang.String documentation()
Description copied from interface:Validator
Return the documentation for a given validator.- Specified by:
documentation
in interfaceValidator
- Returns:
- the documentation for a given validator
-
getInterfaceClass
public java.lang.Class<T> getInterfaceClass()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-