本文整理了Java中io.debezium.config.Field.displayName()
方法的一些代码示例,展示了Field.displayName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Field.displayName()
方法的具体详情如下:
包路径:io.debezium.config.Field
类名称:Field
方法名:displayName
[英]Get the display name of the field.
[中]获取字段的显示名称。
代码示例来源: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 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 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 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 importance.
*
* @param importance the new importance for the field
* @return the new field; never null
*/
public Field withImportance(Importance importance) {
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 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);
}
代码示例来源:origin: io.debezium/debezium-core
/**
* 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);
}
内容来源于网络,如有侵权,请联系作者删除!