com.typesafe.config.ConfigValueType Java Examples
The following examples show how to use
com.typesafe.config.ConfigValueType.
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: ComponentConfigurator.java From streams with Apache License 2.0 | 6 votes |
/** * returns a version of a config with only values - no nested objects. * * @param config config * @return result */ private Config valuesOnly(Config config) { for (String key : config.root().keySet()) { LOGGER.debug("key: ", key); try { ConfigValue value = config.getValue(key); LOGGER.debug("child type: ", value.valueType()); if (value.valueType() == ConfigValueType.OBJECT) { config = config.withoutPath(key); } } catch(ConfigException configExceptions) { LOGGER.debug("error processing"); config = config.withoutPath("\""+key+"\""); } } return config; }
Example #2
Source File: LoopStep.java From envelope with Apache License 2.0 | 6 votes |
@Override public Validations getValidations() { return Validations.builder() .mandatoryPath(MODE_PROPERTY, ConfigValueType.STRING) .mandatoryPath(SOURCE_PROPERTY, ConfigValueType.STRING) .allowedValues(SOURCE_PROPERTY, SOURCE_RANGE, SOURCE_LIST, SOURCE_STEP) .ifPathHasValue(SOURCE_PROPERTY, SOURCE_RANGE, new MandatoryPathValidation(RANGE_START_PROPERTY)) .ifPathHasValue(SOURCE_PROPERTY, SOURCE_RANGE, new MandatoryPathValidation(RANGE_END_PROPERTY)) .ifPathHasValue(SOURCE_PROPERTY, SOURCE_LIST, new MandatoryPathValidation(LIST_PROPERTY, ConfigValueType.LIST)) .ifPathHasValue(SOURCE_PROPERTY, SOURCE_STEP, new MandatoryPathValidation(STEP_PROPERTY, ConfigValueType.STRING)) .ifPathHasValue(SOURCE_PROPERTY, SOURCE_RANGE, new MandatoryPathValidation(PARAMETER_PROPERTY, ConfigValueType.STRING)) .ifPathHasValue(SOURCE_PROPERTY, SOURCE_LIST, new MandatoryPathValidation(PARAMETER_PROPERTY, ConfigValueType.STRING)) .ifPathHasValue(SOURCE_PROPERTY, SOURCE_STEP, new MandatoryPathValidation(SUFFIX_PROPERTY, ConfigValueType.STRING)) .addAll(super.getValidations()) .build(); }
Example #3
Source File: VcapServicesStringParser.java From ditto with Eclipse Public License 2.0 | 6 votes |
private static ConfigObject getAsConfigObject(final ConfigList configList) { final Map<String, ConfigValue> flattenedConfigValues = new HashMap<>(configList.size()); for (int i = 0; i < configList.size(); i++) { final ConfigValue configValue = configList.get(i); final String configPath; if (ConfigValueType.OBJECT == configValue.valueType()) { configPath = getName((ConfigObject) configValue); } else { configPath = String.valueOf(i); } flattenedConfigValues.put(configPath, configValue); } return ConfigValueFactory.fromMap(flattenedConfigValues); }
Example #4
Source File: RegexRowRule.java From envelope with Apache License 2.0 | 6 votes |
@Override public Validations getValidations() { return Validations.builder() .mandatoryPath(REGEX_CONFIG, ConfigValueType.STRING) .mandatoryPath(FIELDS_CONFIG, ConfigValueType.LIST) .add(new Validation() { @Override public ValidationResult validate(Config config) { try { Pattern.compile(config.getString(REGEX_CONFIG)); } catch (PatternSyntaxException pse) { return new ValidationResult(this, Validity.INVALID, "Regular expression does not have valid syntax"); } return new ValidationResult(this, Validity.VALID, "Regular expression has valid syntax"); } @Override public Set<String> getKnownPaths() { return Sets.newHashSet(REGEX_CONFIG); } }) .build(); }
Example #5
Source File: DataStep.java From envelope with Apache License 2.0 | 6 votes |
@Override public Validations getValidations() { return Validations.builder() .optionalPath(CACHE_ENABLED_PROPERTY, ConfigValueType.BOOLEAN) .optionalPath(CACHE_STORAGE_LEVEL_PROPERTY, ConfigValueType.STRING) .optionalPath(SMALL_HINT_PROPERTY, ConfigValueType.BOOLEAN) .optionalPath(PRINT_SCHEMA_ENABLED_PROPERTY, ConfigValueType.BOOLEAN) .optionalPath(PRINT_DATA_ENABLED_PROPERTY, ConfigValueType.BOOLEAN) .ifPathHasValue(PRINT_DATA_ENABLED_PROPERTY, true, Validations.single().optionalPath(PRINT_DATA_LIMIT_PROPERTY, ConfigValueType.NUMBER)) .optionalPath(INPUT_TYPE, ConfigValueType.OBJECT) .optionalPath(DERIVER_TYPE, ConfigValueType.OBJECT) .optionalPath(PLANNER_TYPE, ConfigValueType.OBJECT) .optionalPath(PARTITIONER_TYPE, ConfigValueType.OBJECT) .optionalPath(OUTPUT_TYPE, ConfigValueType.OBJECT) .exactlyOnePathExists(INPUT_TYPE, DERIVER_TYPE) .handlesOwnValidationPath(INPUT_TYPE) .handlesOwnValidationPath(DERIVER_TYPE) .handlesOwnValidationPath(PLANNER_TYPE) .handlesOwnValidationPath(PARTITIONER_TYPE) .handlesOwnValidationPath(OUTPUT_TYPE) .addAll(super.getValidations()) .build(); }
Example #6
Source File: HoconTreeTraversingParser.java From jackson-dataformat-hocon with Apache License 2.0 | 6 votes |
public HoconTreeTraversingParser(ConfigObject n, ObjectCodec codec) { super(0); _rootObject = n; _objectCodec = codec; if (n.valueType() == ConfigValueType.LIST) { _nextToken = JsonToken.START_ARRAY; _nodeCursor = new HoconNodeCursor.Array(n, null); } else if (n.valueType() == ConfigValueType.OBJECT) { if (HoconNodeCursor.isNumericallyIndexed(n)) { _nextToken = JsonToken.START_ARRAY; _nodeCursor = new HoconNodeCursor.NumericallyIndexedObjectBackedArray(n, null); } else { _nextToken = JsonToken.START_OBJECT; _nodeCursor = new HoconNodeCursor.Object(n, null); } } else { // value node _nodeCursor = new HoconNodeCursor.RootValue(n, null); } }
Example #7
Source File: TestValidations.java From envelope with Apache License 2.0 | 6 votes |
@Test public void testValidationsBuilder() { Validations v = Validations .builder() .mandatoryPath("mandatory1") .mandatoryPath("mandatory2", ConfigValueType.STRING) .optionalPath("optional1") .optionalPath("optional2", ConfigValueType.NUMBER) .atMostOnePathExists("atmostone1", "atmostone2") .atMostOnePathExists(ConfigValueType.BOOLEAN, "atmostone3", "atmostone4") .exactlyOnePathExists("exactlyone1", "exactlyone2") .exactlyOnePathExists(ConfigValueType.STRING, "exactlyone3", "exactlyone4") .ifPathHasValue("hasvalue", true, Validations.single().allowedValues("hasvalue", true)) .ifPathExists("pathexists", Validations.single().mandatoryPath("pathexists")) .allowedValues("allowed", "hello", "world") .build(); // The specified validations plus the automatic non-empty validations assertEquals(26, v.size()); }
Example #8
Source File: EbeanParsedConfig.java From play-ebean with Apache License 2.0 | 6 votes |
/** * Parse a play configuration. * * @param config play configuration * @return ebean parsed configuration * @see com.typesafe.config.Config */ public static EbeanParsedConfig parseFromConfig(Config config) { Config playEbeanConfig = config.getConfig("play.ebean"); String defaultDatasource = playEbeanConfig.getString("defaultDatasource"); String ebeanConfigKey = playEbeanConfig.getString("config"); Map<String, List<String>> datasourceModels = new HashMap<>(); if (config.hasPath(ebeanConfigKey)) { Config ebeanConfig = config.getConfig(ebeanConfigKey); ebeanConfig.root().forEach((key, raw) -> { List<String> models; if (raw.valueType() == ConfigValueType.STRING) { // Support legacy comma separated string models = Arrays.asList(((String) raw.unwrapped()).split(",")); } else { models = ebeanConfig.getStringList(key); } datasourceModels.put(key, models); }); } return new EbeanParsedConfig(defaultDatasource, datasourceModels); }
Example #9
Source File: DelimitedTranslator.java From envelope with Apache License 2.0 | 6 votes |
@Override public Validations getValidations() { return Validations.builder() .mandatoryPath(DELIMITER_CONFIG_NAME, ConfigValueType.STRING) .mandatoryPath(SCHEMA_CONFIG, ConfigValueType.OBJECT) .add(new SupportedFieldTypesValidation(SCHEMA_CONFIG, new HashSet<DataType>(Arrays.asList(new DecimalType(), DataTypes.StringType, DataTypes.FloatType, DataTypes.DoubleType, DataTypes.ShortType, DataTypes.IntegerType, DataTypes.LongType, DataTypes.BooleanType, DataTypes.BinaryType, DataTypes.DateType, DataTypes.TimestampType)))) .optionalPath(DELIMITER_REGEX_CONFIG_NAME, ConfigValueType.BOOLEAN) .optionalPath(TIMESTAMP_FORMAT_CONFIG_NAME, ConfigValueType.LIST) .handlesOwnValidationPath(SCHEMA_CONFIG) .build(); }
Example #10
Source File: BitemporalHistoryPlanner.java From envelope with Apache License 2.0 | 6 votes |
@Override public Validations getValidations() { return Validations.builder() .mandatoryPath(KEY_FIELD_NAMES_CONFIG_NAME, ConfigValueType.LIST) .mandatoryPath(VALUE_FIELD_NAMES_CONFIG_NAME, ConfigValueType.LIST) .mandatoryPath(TIMESTAMP_FIELD_NAMES_CONFIG_NAME, ConfigValueType.LIST) .mandatoryPath(EVENT_TIME_EFFECTIVE_FROM_FIELD_NAMES_CONFIG_NAME, ConfigValueType.LIST) .mandatoryPath(EVENT_TIME_EFFECTIVE_TO_FIELD_NAMES_CONFIG_NAME, ConfigValueType.LIST) .mandatoryPath(SYSTEM_TIME_EFFECTIVE_FROM_FIELD_NAMES_CONFIG_NAME, ConfigValueType.LIST) .mandatoryPath(SYSTEM_TIME_EFFECTIVE_TO_FIELD_NAMES_CONFIG_NAME, ConfigValueType.LIST) .optionalPath(CURRENT_FLAG_FIELD_NAME_CONFIG_NAME, ConfigValueType.STRING) .optionalPath(CURRENT_FLAG_YES_CONFIG_NAME, ConfigValueType.STRING) .optionalPath(CURRENT_FLAG_NO_CONFIG_NAME, ConfigValueType.STRING) .optionalPath(SURROGATE_KEY_FIELD_NAME_CONFIG_NAME, ConfigValueType.STRING) .optionalPath(CARRY_FORWARD_CONFIG_NAME, ConfigValueType.BOOLEAN) .optionalPath(EVENT_TIME_MODEL_CONFIG_NAME, ConfigValueType.OBJECT) .optionalPath(SYSTEM_TIME_MODEL_CONFIG_NAME, ConfigValueType.OBJECT) .handlesOwnValidationPath(EVENT_TIME_MODEL_CONFIG_NAME) .handlesOwnValidationPath(SYSTEM_TIME_MODEL_CONFIG_NAME) .build(); }
Example #11
Source File: DecisionStep.java From envelope with Apache License 2.0 | 6 votes |
@Override public Validations getValidations() { return Validations.builder() .mandatoryPath(IF_TRUE_STEP_NAMES_PROPERTY, ConfigValueType.LIST) .mandatoryPath(DECISION_METHOD_PROPERTY, ConfigValueType.STRING) .allowedValues(DECISION_METHOD_PROPERTY, LITERAL_DECISION_METHOD, STEP_BY_KEY_DECISION_METHOD, STEP_BY_VALUE_DECISION_METHOD) .ifPathHasValue(DECISION_METHOD_PROPERTY, LITERAL_DECISION_METHOD, new MandatoryPathValidation(LITERAL_RESULT_PROPERTY, ConfigValueType.BOOLEAN)) .ifPathHasValue(DECISION_METHOD_PROPERTY, STEP_BY_KEY_DECISION_METHOD, new MandatoryPathValidation(STEP_BY_KEY_KEY_PROPERTY, ConfigValueType.STRING)) .ifPathHasValue(DECISION_METHOD_PROPERTY, STEP_BY_KEY_DECISION_METHOD, new MandatoryPathValidation(STEP_BY_KEY_STEP_PROPERTY, ConfigValueType.STRING)) .ifPathHasValue(DECISION_METHOD_PROPERTY, STEP_BY_VALUE_DECISION_METHOD, new MandatoryPathValidation(STEP_BY_VALUE_STEP_PROPERTY, ConfigValueType.STRING)) .addAll(super.getValidations()) .build(); }
Example #12
Source File: EventTimeHistoryPlanner.java From envelope with Apache License 2.0 | 6 votes |
@Override public Validations getValidations() { return Validations.builder() .mandatoryPath(KEY_FIELD_NAMES_CONFIG_NAME, ConfigValueType.LIST) .mandatoryPath(VALUE_FIELD_NAMES_CONFIG_NAME, ConfigValueType.LIST) .mandatoryPath(TIMESTAMP_FIELD_NAMES_CONFIG_NAME, ConfigValueType.LIST) .mandatoryPath(EFFECTIVE_FROM_FIELD_NAMES_CONFIG_NAME, ConfigValueType.LIST) .mandatoryPath(EFFECTIVE_TO_FIELD_NAMES_CONFIG_NAME, ConfigValueType.LIST) .optionalPath(CURRENT_FLAG_FIELD_NAME_CONFIG_NAME, ConfigValueType.STRING) .optionalPath(CURRENT_FLAG_YES_CONFIG_NAME, ConfigValueType.STRING) .optionalPath(CURRENT_FLAG_NO_CONFIG_NAME, ConfigValueType.STRING) .optionalPath(LAST_UPDATED_FIELD_NAME_CONFIG_NAME, ConfigValueType.STRING) .optionalPath(SURROGATE_KEY_FIELD_NAME_CONFIG_NAME, ConfigValueType.STRING) .optionalPath(CARRY_FORWARD_CONFIG_NAME, ConfigValueType.BOOLEAN) .optionalPath(EVENT_TIME_MODEL_CONFIG_NAME, ConfigValueType.OBJECT) .optionalPath(LAST_UPDATED_TIME_MODEL_CONFIG_NAME, ConfigValueType.OBJECT) .handlesOwnValidationPath(EVENT_TIME_MODEL_CONFIG_NAME) .handlesOwnValidationPath(LAST_UPDATED_TIME_MODEL_CONFIG_NAME) .build(); }
Example #13
Source File: Config.java From para with Apache License 2.0 | 6 votes |
/** * Initializes the configuration class by loading the configuration file. * @param conf overrides the default configuration */ public static void init(com.typesafe.config.Config conf) { try { config = ConfigFactory.load().getConfig(PARA); if (conf != null) { config = conf.withFallback(config); } configMap = new HashMap<>(); for (Map.Entry<String, ConfigValue> con : config.entrySet()) { if (con.getValue().valueType() != ConfigValueType.LIST) { configMap.put(con.getKey(), config.getString(con.getKey())); } } } catch (Exception ex) { logger.warn("Para configuration file 'application.(conf|json|properties)' is invalid or missing from classpath."); config = com.typesafe.config.ConfigFactory.empty(); } }
Example #14
Source File: TemporaryJobs.java From helios with Apache License 2.0 | 5 votes |
private static List<String> getListByKey(final String key, final Config config) { final ConfigList endpointList = config.getList(key); final List<String> stringList = Lists.newArrayList(); for (final ConfigValue v : endpointList) { if (v.valueType() != ConfigValueType.STRING) { throw new RuntimeException("Item in " + key + " list [" + v + "] is not a string"); } stringList.add((String) v.unwrapped()); } return stringList; }
Example #15
Source File: BatchStep.java From envelope with Apache License 2.0 | 5 votes |
@Override public Validations getValidations() { return Validations.builder() .add(new RepartitionValidation()) .optionalPath(REPETITION_PREFIX, ConfigValueType.OBJECT) .handlesOwnValidationPath(REPETITION_PREFIX) .addAll(super.getValidations()) .build(); }
Example #16
Source File: Runner.java From envelope with Apache License 2.0 | 5 votes |
void initializeUDFs(Config config) { if (!config.hasPath(UDFS_SECTION_CONFIG)) return; ConfigList udfList = config.getList(UDFS_SECTION_CONFIG); for (ConfigValue udfValue : udfList) { ConfigValueType udfValueType = udfValue.valueType(); if (!udfValueType.equals(ConfigValueType.OBJECT)) { throw new RuntimeException("UDF list must contain UDF objects"); } Config udfConfig = ((ConfigObject)udfValue).toConfig(); for (String path : Lists.newArrayList(UDFS_NAME, UDFS_CLASS)) { if (!udfConfig.hasPath(path)) { throw new RuntimeException("UDF entries must provide '" + path + "'"); } } String name = udfConfig.getString(UDFS_NAME); String className = udfConfig.getString(UDFS_CLASS); // null third argument means that registerJava will infer the return type Contexts.getSparkSession().udf().registerJava(name, className, null); LOG.info("Registered Spark SQL UDF: " + name); } }
Example #17
Source File: TestValidator.java From envelope with Apache License 2.0 | 5 votes |
@Test public void testValid() { ProvidesValidations validee = new ProvidesValidations() { @Override public Validations getValidations() { return Validations.builder().mandatoryPath("hello", ConfigValueType.STRING).build(); } }; Properties configProps = new Properties(); configProps.setProperty("hello", "world"); Config config = ConfigFactory.parseProperties(configProps); assertNoValidationFailures(validee, config); }
Example #18
Source File: AvroSchema.java From envelope with Apache License 2.0 | 5 votes |
@Override public Validations getValidations() { return Validations.builder() .exactlyOnePathExists(ConfigValueType.STRING, AVRO_FILE_CONFIG, AVRO_LITERAL_CONFIG) .ifPathExists(AVRO_FILE_CONFIG, new AvroSchemaPathValidation(AVRO_FILE_CONFIG)) .ifPathExists(AVRO_LITERAL_CONFIG, new AvroSchemaLiteralValidation(AVRO_LITERAL_CONFIG)) .build(); }
Example #19
Source File: TypesafeConfigModule.java From typesafeconfig-guice with Apache License 2.0 | 5 votes |
@SuppressWarnings({ "unchecked", "rawtypes" }) private Object getConfigValue(Class<?> paramClass, Type paramType, String path) { Optional<Object> extractedValue = ConfigExtractors.extractConfigValue(config, paramClass, path); if (extractedValue.isPresent()) { return extractedValue.get(); } ConfigValue configValue = config.getValue(path); ConfigValueType valueType = configValue.valueType(); if (valueType.equals(ConfigValueType.OBJECT) && Map.class.isAssignableFrom(paramClass)) { ConfigObject object = config.getObject(path); return object.unwrapped(); } else if (valueType.equals(ConfigValueType.OBJECT)) { Object bean = ConfigBeanFactory.create(config.getConfig(path), paramClass); return bean; } else if (valueType.equals(ConfigValueType.LIST) && List.class.isAssignableFrom(paramClass)) { Type listType = ((ParameterizedType) paramType).getActualTypeArguments()[0]; Optional<List<?>> extractedListValue = ListExtractors.extractConfigListValue(config, listType, path); if (extractedListValue.isPresent()) { return extractedListValue.get(); } else { List<? extends Config> configList = config.getConfigList(path); return configList.stream() .map(cfg -> { Object created = ConfigBeanFactory.create(cfg, (Class) listType); return created; }) .collect(Collectors.toList()); } } throw new RuntimeException("Cannot obtain config value for " + paramType + " at path: " + path); }
Example #20
Source File: TaskStep.java From envelope with Apache License 2.0 | 5 votes |
@Override public Validations getValidations() { return Validations.builder() .mandatoryPath(TASK_CONFIG, ConfigValueType.OBJECT) .handlesOwnValidationPath(TASK_CONFIG) .addAll(super.getValidations()) .build(); }
Example #21
Source File: EventTimeUpsertPlanner.java From envelope with Apache License 2.0 | 5 votes |
@Override public Validations getValidations() { return Validations.builder() .mandatoryPath(KEY_FIELD_NAMES_CONFIG_NAME, ConfigValueType.LIST) .mandatoryPath(VALUE_FIELD_NAMES_CONFIG_NAME, ConfigValueType.LIST) .mandatoryPath(TIMESTAMP_FIELD_NAMES_CONFIG_NAME, ConfigValueType.LIST) .optionalPath(LAST_UPDATED_FIELD_NAME_CONFIG_NAME, ConfigValueType.STRING) .optionalPath(SURROGATE_KEY_FIELD_NAME_CONFIG_NAME, ConfigValueType.STRING) .optionalPath(EVENT_TIME_MODEL_CONFIG_NAME, ConfigValueType.OBJECT) .optionalPath(LAST_UPDATED_TIME_MODEL_CONFIG_NAME, ConfigValueType.OBJECT) .handlesOwnValidationPath(EVENT_TIME_MODEL_CONFIG_NAME) .handlesOwnValidationPath(LAST_UPDATED_TIME_MODEL_CONFIG_NAME) .build(); }
Example #22
Source File: BaseMessageTemplates.java From UHC with MIT License | 5 votes |
@Override public List<String> getRawStrings(String path) { final ConfigValue value = config.getValue(path); if (value.valueType() == ConfigValueType.LIST) { return config.getStringList(path); } return Lists.newArrayList(config.getString(path)); }
Example #23
Source File: ConfigUtils.java From envelope with Apache License 2.0 | 5 votes |
public static <T> T getOrElse(Config config, String path, T orElse) { if (config.hasPath(path)) { if (config.getValue(path).valueType() == ConfigValueType.OBJECT) { return (T) config.getConfig(path); } else { return (T) config.getAnyRef(path); } } else { return orElse; } }
Example #24
Source File: FileSystemInput.java From envelope with Apache License 2.0 | 5 votes |
@Override public Validations getValidations() { return Validations.builder() .mandatoryPath(FORMAT_CONFIG, ConfigValueType.STRING) .mandatoryPath(PATH_CONFIG, ConfigValueType.STRING) .allowedValues(FORMAT_CONFIG, PARQUET_FORMAT, JSON_FORMAT, INPUT_FORMAT_FORMAT, TEXT_FORMAT, CSV_FORMAT) .ifPathHasValue(FORMAT_CONFIG, TEXT_FORMAT, Validations.single().optionalPath(TRANSLATOR_CONFIG, ConfigValueType.OBJECT)) .ifPathHasValue(FORMAT_CONFIG, INPUT_FORMAT_FORMAT, Validations.single().mandatoryPath(INPUT_FORMAT_TYPE_CONFIG, ConfigValueType.STRING)) .ifPathHasValue(FORMAT_CONFIG, INPUT_FORMAT_FORMAT, Validations.single().mandatoryPath(TRANSLATOR_CONFIG, ConfigValueType.OBJECT)) .optionalPath(SCHEMA_CONFIG, ConfigValueType.OBJECT) .optionalPath(CSV_HEADER_CONFIG) .optionalPath(CSV_SEPARATOR_CONFIG) .optionalPath(CSV_ENCODING_CONFIG) .optionalPath(CSV_QUOTE_CONFIG) .optionalPath(CSV_ESCAPE_CONFIG) .optionalPath(CSV_COMMENT_CONFIG) .optionalPath(CSV_INFER_SCHEMA_CONFIG) .optionalPath(CSV_IGNORE_LEADING_CONFIG) .optionalPath(CSV_IGNORE_TRAILING_CONFIG) .optionalPath(CSV_NULL_VALUE_CONFIG) .optionalPath(CSV_NAN_VALUE_CONFIG) .optionalPath(CSV_POS_INF_CONFIG) .optionalPath(CSV_NEG_INF_CONFIG) .optionalPath(CSV_DATE_CONFIG) .optionalPath(CSV_TIMESTAMP_CONFIG) .optionalPath(CSV_MAX_COLUMNS_CONFIG) .optionalPath(CSV_MAX_CHARS_COLUMN_CONFIG) .optionalPath(CSV_MAX_MALFORMED_LOG_CONFIG) .optionalPath(CSV_MODE_CONFIG) .handlesOwnValidationPath(TRANSLATOR_CONFIG) .handlesOwnValidationPath(SCHEMA_CONFIG) .add(new InputTranslatorCompatibilityValidation()) .build(); }
Example #25
Source File: OutputEventHandler.java From envelope with Apache License 2.0 | 5 votes |
@Override public Validations getValidations() { return Validations.builder() .mandatoryPath(OUTPUT_CONFIG, ConfigValueType.OBJECT) .optionalPath(LOG_ALL_EVENTS_CONFIG, ConfigValueType.BOOLEAN) .handlesOwnValidationPath(OUTPUT_CONFIG) .add(new CompatibleOutputValidation()) .build(); }
Example #26
Source File: ProtobufTranslator.java From envelope with Apache License 2.0 | 5 votes |
@Override public Validations getValidations() { return Validations.builder() .mandatoryPath(SCHEMA_CONFIG, ConfigValueType.OBJECT) .ifPathExists(SCHEMA_CONFIG, new ProtobufTranslatorSchemaTypeValidation(SCHEMA_CONFIG)) .handlesOwnValidationPath(SCHEMA_CONFIG) .build(); }
Example #27
Source File: AvroTranslator.java From envelope with Apache License 2.0 | 5 votes |
@Override public Validations getValidations() { return Validations.builder() .mandatoryPath(SCHEMA_CONFIG, ConfigValueType.OBJECT) .handlesOwnValidationPath(SCHEMA_CONFIG) .build(); }
Example #28
Source File: JdbcOutput.java From envelope with Apache License 2.0 | 5 votes |
@Override public Validations getValidations() { return Validations.builder() .mandatoryPath(JDBC_CONFIG_URL, ConfigValueType.STRING) .mandatoryPath(JDBC_CONFIG_TABLENAME, ConfigValueType.STRING) .mandatoryPath(JDBC_CONFIG_USERNAME, ConfigValueType.STRING) .mandatoryPath(JDBC_CONFIG_PASSWORD, ConfigValueType.STRING) .allowEmptyValue(JDBC_CONFIG_PASSWORD) .build(); }
Example #29
Source File: LogOutput.java From envelope with Apache License 2.0 | 5 votes |
@Override public Validations getValidations() { return Validations.builder() .optionalPath(DELIMITER_CONFIG_NAME, ConfigValueType.STRING) .optionalPath(LOG_LEVEL_CONFIG_NAME, ConfigValueType.STRING) .build(); }
Example #30
Source File: PivotDeriver.java From envelope with Apache License 2.0 | 5 votes |
@Override public Validations getValidations() { return Validations.builder() .mandatoryPath(STEP_NAME_CONFIG, ConfigValueType.STRING) .mandatoryPath(ENTITY_KEY_FIELD_NAMES_CONFIG, ConfigValueType.LIST) .mandatoryPath(PIVOT_KEY_FIELD_NAME_CONFIG, ConfigValueType.STRING) .mandatoryPath(PIVOT_VALUE_FIELD_NAME_CONFIG, ConfigValueType.STRING) .optionalPath(PIVOT_KEYS_SOURCE_CONFIG, ConfigValueType.STRING) .allowedValues(PIVOT_KEYS_SOURCE_CONFIG, PIVOT_KEYS_SOURCE_DYNAMIC, PIVOT_KEYS_SOURCE_STATIC) .ifPathHasValue(PIVOT_KEYS_SOURCE_CONFIG, PIVOT_KEYS_SOURCE_STATIC, Validations.single().mandatoryPath(PIVOT_KEYS_LIST_CONFIG, ConfigValueType.LIST)) .build(); }