All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.snowflake.kafka.connector.config.TopicToTableValidator Maven / Gradle / Ivy

The newest version!
package com.snowflake.kafka.connector.config;

import com.snowflake.kafka.connector.Utils;
import org.apache.kafka.common.config.ConfigDef;
import org.apache.kafka.common.config.ConfigException;

class TopicToTableValidator implements ConfigDef.Validator {
  public TopicToTableValidator() {}

  public void ensureValid(String name, Object value) {
    String s = (String) value;
    if (s != null && !s.isEmpty()) // this value is optional and can be empty
    {
      if (Utils.parseTopicToTableMap(s) == null) {
        throw new ConfigException(
            name, value, "Format: :,:,...");
      }
    }
  }

  public String toString() {
    return "Topic to table map format : comma-separated tuples, e.g."
        + " :,:,... ";
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy