Package io.debezium.config
Interface EnumeratedValue
public interface EnumeratedValue
A configuration option with a fixed set of possible values, i.e. an enum. To be implemented by any enum
types used with
.
invalid reference
ConfigBuilder
- Author:
- Brendan Maguire
-
Method Summary
Modifier and TypeMethodDescriptiongetValue()Returns the string representation of this valuedefault booleanDetermine whether this enumerated option matches the supplied value.static <T extends Enum<T> & EnumeratedValue>
TParse the supplied value into the matching enum constant.static <T extends Enum<T> & EnumeratedValue>
TParse the supplied value into the matching enum constant, falling back to the supplied default value.
-
Method Details
-
getValue
String getValue()Returns the string representation of this value- Returns:
- The string representation of this value
-
matches
Determine whether this enumerated option matches the supplied value.- Parameters:
value- the value to compare; may be null- Returns:
- true when the value matches this option
-
parse
Parse the supplied value into the matching enum constant.- Type Parameters:
T- enum type- Parameters:
enumType- the enum type to parsevalue- the supplied value- Returns:
- the matching enum value
-
parse
static <T extends Enum<T> & EnumeratedValue> T parse(Class<T> enumType, String value, String defaultValue) Parse the supplied value into the matching enum constant, falling back to the supplied default value.- Type Parameters:
T- enum type- Parameters:
enumType- the enum type to parsevalue- the supplied valuedefaultValue- the default value string- Returns:
- the matching enum value
- Throws:
IllegalArgumentException- if no match can be found
-