com.github.jcustenborder.kafka.connect.utils.config.ValidEnum Java Examples

The following examples show how to use com.github.jcustenborder.kafka.connect.utils.config.ValidEnum. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Validators.java    From connect-utils with Apache License 2.0 5 votes vote down vote up
/**
 * Method is used to create a new INSTANCE of the enum validator.
 *
 * @param enumClass Enum class with the entries to validate for.
 * @param excludes  Enum entries to exclude from the validator.
 * @return validator
 */
public static Validator validEnum(Class<? extends Enum> enumClass, Enum... excludes) {
  String[] ex = new String[excludes.length];
  for (int i = 0; i < ex.length; i++) {
    ex[i] = excludes[i].toString();
  }
  return ValidEnum.of(enumClass, ex);
}
 
Example #2
Source File: ChangeCaseConfig.java    From kafka-connect-transform-common with Apache License 2.0 4 votes vote down vote up
public static ConfigDef config() {
  return new ConfigDef()
      .define(FROM_CONFIG, ConfigDef.Type.STRING, ConfigDef.NO_DEFAULT_VALUE, ValidEnum.of(CaseFormat.class), ConfigDef.Importance.HIGH, FROM_DOC)
      .define(TO_CONFIG, ConfigDef.Type.STRING, ConfigDef.NO_DEFAULT_VALUE, ValidEnum.of(CaseFormat.class), ConfigDef.Importance.HIGH, TO_DOC);
}
 
Example #3
Source File: ChangeTopicCaseConfig.java    From kafka-connect-transform-common with Apache License 2.0 4 votes vote down vote up
public static ConfigDef config() {
  return new ConfigDef()
      .define(FROM_CONFIG, ConfigDef.Type.STRING, ConfigDef.NO_DEFAULT_VALUE, ValidEnum.of(CaseFormat.class), ConfigDef.Importance.HIGH, FROM_DOC)
      .define(TO_CONFIG, ConfigDef.Type.STRING, ConfigDef.NO_DEFAULT_VALUE, ValidEnum.of(CaseFormat.class), ConfigDef.Importance.HIGH, TO_DOC);
}