io.debezium.config.Field.importance()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(10.5k)|赞(0)|评价(0)|浏览(108)

本文整理了Java中io.debezium.config.Field.importance()方法的一些代码示例,展示了Field.importance()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Field.importance()方法的具体详情如下:
包路径:io.debezium.config.Field
类名称:Field
方法名:importance

Field.importance介绍

[英]Get the importance of this field.
[中]了解这个领域的重要性。

代码示例

代码示例来源:origin: debezium/debezium

/**
 * Create and return a new Field instance that is a copy of this field but with the given description.
 * 
 * @param description the new description for the new field
 * @return the new field; never null
 */
public Field withDescription(String description) {
  return new Field(name(), displayName, type(), width, description, importance(), dependents,
      defaultValueGenerator, validator, recommender);
}

代码示例来源:origin: debezium/debezium

/**
 * Create and return a new Field instance that is a copy of this field but with the given display name.
 * 
 * @param dependents the names of the fields that depend on this field
 * @return the new field; never null
 */
public Field withDependents(String... dependents) {
  return new Field(name(), displayName(), type(), width, description(), importance(),
      Arrays.asList(dependents), defaultValueGenerator, validator, recommender);
}

代码示例来源:origin: debezium/debezium

/**
 * Create and return a new Field instance that is a copy of this field but with the given default value.
 * 
 * @param defaultValue the new default value for the new field
 * @return the new field; never null
 */
public Field withDefault(boolean defaultValue) {
  return new Field(name(), displayName(), type(), width, description(), importance(), dependents,
      () -> Boolean.valueOf(defaultValue), validator, recommender);
}

代码示例来源:origin: debezium/debezium

/**
 * Create and return a new Field instance that is a copy of this field but with the given display name.
 * 
 * @param displayName the new display name for the field
 * @return the new field; never null
 */
public Field withDisplayName(String displayName) {
  return new Field(name(), displayName, type(), width, description(), importance(), dependents,
      defaultValueGenerator, validator, recommender);
}

代码示例来源:origin: debezium/debezium

/**
 * Create and return a new Field instance that is a copy of this field but with the given default value.
 * 
 * @param defaultValue the new default value for the new field
 * @return the new field; never null
 */
public Field withDefault(long defaultValue) {
  return new Field(name(), displayName(), type(), width, description(), importance(), dependents,
      () -> defaultValue, validator, recommender);
}

代码示例来源:origin: debezium/debezium

/**
 * Create and return a new Field instance that is a copy of this field but with the given default value.
 * 
 * @param defaultValueGenerator the supplier for the new default value for the new field, called whenever a default value
 *            is needed
 * @return the new field; never null
 */
public Field withDefault(BooleanSupplier defaultValueGenerator) {
  return new Field(name(), displayName(), type(), width, description(), importance(), dependents,
      defaultValueGenerator::getAsBoolean, validator, recommender);
}

代码示例来源:origin: debezium/debezium

/**
 * Create and return a new Field instance that is a copy of this field but with the given default value.
 * 
 * @param defaultValueGenerator the supplier for the new default value for the new field, called whenever a default value
 *            is needed
 * @return the new field; never null
 */
public Field withDefault(IntSupplier defaultValueGenerator) {
  return new Field(name(), displayName(), type(), width, description(), importance(), dependents,
      defaultValueGenerator::getAsInt, validator, recommender);
}

代码示例来源:origin: debezium/debezium

/**
 * Create and return a new Field instance that is a copy of this field but with the given default value.
 * 
 * @param defaultValueGenerator the supplier for the new default value for the new field, called whenever a default value
 *            is needed
 * @return the new field; never null
 */
public Field withDefault(LongSupplier defaultValueGenerator) {
  return new Field(name(), displayName(), type(), width, description(), importance(), dependents,
      defaultValueGenerator::getAsLong, validator, recommender);
}

代码示例来源:origin: debezium/debezium

/**
 * Create and return a new Field instance that is a copy of this field but that uses no validation.
 * 
 * @return the new field; never null
 */
public Field withNoValidation() {
  return new Field(name(), displayName(), type(), width, description(), importance(), dependents,
      defaultValueGenerator, null, recommender);
}

代码示例来源:origin: debezium/debezium

/**
 * Create and return a new Field instance that is a copy of this field but with the given width.
 * 
 * @param width the new width for the field
 * @return the new field; never null
 */
public Field withWidth(Width width) {
  return new Field(name(), displayName(), type(), width, description(), importance(), dependents,
      defaultValueGenerator, validator, recommender);
}

代码示例来源:origin: debezium/debezium

/**
 * Create and return a new Field instance that is a copy of this field but with the given type.
 * 
 * @param type the new type for the field
 * @return the new field; never null
 */
public Field withType(Type type) {
  return new Field(name(), displayName(), type, width(), description(), importance(), dependents,
      defaultValueGenerator, validator, recommender);
}

代码示例来源:origin: debezium/debezium

/**
 * Create and return a new Field instance that is a copy of this field but with the given default value.
 * 
 * @param defaultValue the new default value for the new field
 * @return the new field; never null
 */
public Field withDefault(String defaultValue) {
  return new Field(name(), displayName(), type(), width, description(), importance(), dependents,
      () -> defaultValue, validator, recommender);
}

代码示例来源:origin: debezium/debezium

/**
 * Create and return a new Field instance that is a copy of this field but with the given default value.
 * 
 * @param defaultValue the new default value for the new field
 * @return the new field; never null
 */
public Field withDefault(int defaultValue) {
  return new Field(name(), displayName(), type(), width, description(), importance(), dependents,
      () -> defaultValue, validator, recommender);
}

代码示例来源:origin: debezium/debezium

/**
 * Create and return a new Field instance that is a copy of this field but with the given recommender.
 * 
 * @param recommender the recommender; may be null
 * @return the new field; never null
 */
public Field withRecommender(Recommender recommender) {
  return new Field(name(), displayName(), type(), width, description(), importance(), dependents,
      defaultValueGenerator, validator, recommender);
}

代码示例来源:origin: debezium/debezium

/**
 * Create and return a new Field instance that is a copy of this field but that in addition to {@link #validator() existing
 * validation} the supplied validation function(s) are also used.
 * 
 * @param validators the additional validation function(s); may be null
 * @return the new field; never null
 */
public Field withValidation(Validator... validators) {
  Validator actualValidator = validator;
  for (Validator validator : validators) {
    if (validator != null) actualValidator = validator.and(actualValidator);
  }
  return new Field(name(), displayName(), type(), width(), description(), importance(), dependents,
      defaultValueGenerator, actualValidator, recommender);
}

代码示例来源:origin: debezium/debezium

/**
 * Add this field to the given configuration definition.
 * 
 * @param configDef the definition of the configuration; may be null if none of the fields are to be added
 * @param groupName the name of the group; may be null
 * @param fields the fields to be added as a group to the definition of the configuration
 * @return the updated configuration; never null
 */
public static ConfigDef group(ConfigDef configDef, String groupName, Field... fields) {
  if (configDef != null) {
    if (groupName != null) {
      for (int i = 0; i != fields.length; ++i) {
        Field f = fields[i];
        configDef.define(f.name(), f.type(), f.defaultValue(), null, f.importance(), f.description(),
                 groupName, i + 1, f.width(), f.displayName(), f.dependents(), null);
      }
    } else {
      for (int i = 0; i != fields.length; ++i) {
        Field f = fields[i];
        configDef.define(f.name(), f.type(), f.defaultValue(), null, f.importance(), f.description(),
                 null, 1, f.width(), f.displayName(), f.dependents(), null);
      }
    }
  }
  return configDef;
}

代码示例来源:origin: debezium/debezium

private void validateFieldDef(Field expected) {
    ConfigDef configDef = connector.config();
    assertThat(configDef.names()).contains(expected.name());
    ConfigDef.ConfigKey key = configDef.configKeys().get(expected.name());
    assertThat(key).isNotNull();
    assertThat(key.name).isEqualTo(expected.name());
    assertThat(key.displayName).isEqualTo(expected.displayName());
    assertThat(key.importance).isEqualTo(expected.importance());
    assertThat(key.documentation).isEqualTo(expected.description());
    assertThat(key.type).isEqualTo(expected.type());
    assertThat(key.defaultValue).isEqualTo(expected.defaultValue());
    assertThat(key.dependents).isEqualTo(expected.dependents());
    assertThat(key.width).isNotNull();
    assertThat(key.group).isNotNull();
    assertThat(key.orderInGroup).isGreaterThan(0);
    assertThat(key.validator).isNull();
    assertThat(key.recommender).isNull();
  }
}

代码示例来源:origin: debezium/debezium

protected static void assertConfigDefIsValid(Connector connector, io.debezium.config.Field.Set fields) {
    ConfigDef configDef = connector.config();
    assertThat(configDef).isNotNull();
    fields.forEach(expected -> {
      assertThat(configDef.names()).contains(expected.name());
      ConfigKey key = configDef.configKeys().get(expected.name());
      assertThat(key).isNotNull();
      assertThat(key.name).isEqualTo(expected.name());
      assertThat(key.displayName).isEqualTo(expected.displayName());
      assertThat(key.importance).isEqualTo(expected.importance());
      assertThat(key.documentation).isEqualTo(expected.description());
      assertThat(key.type).isEqualTo(expected.type());
      if (expected.equals(MySqlConnectorConfig.DATABASE_HISTORY) || expected.equals(MySqlConnectorConfig.JDBC_DRIVER)) {
        assertThat(((Class<?>) key.defaultValue).getName()).isEqualTo((String) expected.defaultValue());
      } else if (!expected.equals(MySqlConnectorConfig.SERVER_ID)) {
        assertThat(key.defaultValue).isEqualTo(expected.defaultValue());
      }
      assertThat(key.dependents).isEqualTo(expected.dependents());
      assertThat(key.width).isNotNull();
      assertThat(key.group).isNotNull();
      assertThat(key.orderInGroup).isGreaterThan(0);
      assertThat(key.validator).isNull();
      assertThat(key.recommender).isNull();
    });
  }
}

代码示例来源:origin: debezium/debezium

protected static void assertConfigDefIsValid(Connector connector, io.debezium.config.Field.Set fields) {
  ConfigDef configDef = connector.config();
  assertThat(configDef).isNotNull();
  fields.forEach(expected -> {
    assertThat(configDef.names()).contains(expected.name());
    ConfigKey key = configDef.configKeys().get(expected.name());
    assertThat(key).isNotNull();
    assertThat(key.name).isEqualTo(expected.name());
    assertThat(key.displayName).isEqualTo(expected.displayName());
    assertThat(key.importance).isEqualTo(expected.importance());
    assertThat(key.documentation).isEqualTo(expected.description());
    assertThat(key.type).isEqualTo(expected.type());
    assertThat(key.defaultValue).isEqualTo(expected.defaultValue());
    assertThat(key.dependents).isEqualTo(expected.dependents());
    assertThat(key.width).isNotNull();
    assertThat(key.group).isNotNull();
    assertThat(key.orderInGroup).isGreaterThan(0);
    assertThat(key.validator).isNull();
    assertThat(key.recommender).isNull();
  });
}

代码示例来源:origin: io.debezium/debezium-core

/**
 * Create and return a new Field instance that is a copy of this field but that uses no validation.
 * 
 * @return the new field; never null
 */
public Field withNoValidation() {
  return new Field(name(), displayName(), type(), width, description(), importance(), dependents,
      defaultValueGenerator, null, recommender);
}

相关文章