本文整理汇总了Java中com.hp.autonomy.frontend.configuration.validation.OptionalConfigurationComponent类的典型用法代码示例。如果您正苦于以下问题:Java OptionalConfigurationComponent类的具体用法?Java OptionalConfigurationComponent怎么用?Java OptionalConfigurationComponent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OptionalConfigurationComponent类属于com.hp.autonomy.frontend.configuration.validation包,在下文中一共展示了OptionalConfigurationComponent类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEnabledValidationMap
import com.hp.autonomy.frontend.configuration.validation.OptionalConfigurationComponent; //导入依赖的package包/类
@Override
@JsonIgnore
public Map<String, OptionalConfigurationComponent<?>> getEnabledValidationMap() {
final Map<String, OptionalConfigurationComponent<?>> validationMap = getValidationMap();
final Iterator<Map.Entry<String, OptionalConfigurationComponent<?>>> iterator = validationMap.entrySet().iterator();
while (iterator.hasNext()) {
final Map.Entry<String, OptionalConfigurationComponent<?>> entry = iterator.next();
if (BooleanUtils.isFalse(entry.getValue().getEnabled())) {
iterator.remove();
}
}
return validationMap;
}
示例2: getValidationMap
import com.hp.autonomy.frontend.configuration.validation.OptionalConfigurationComponent; //导入依赖的package包/类
@Override
public Map<String, OptionalConfigurationComponent<?>> getValidationMap() {
final Map<String, OptionalConfigurationComponent<?>> validationMap = super.getValidationMap();
if(validationMap.containsKey("savedSearchConfig")) {
validationMap.put("savedSearches", validationMap.remove("savedSearchConfig"));
}
return validationMap;
}
示例3: getValidationMap
import com.hp.autonomy.frontend.configuration.validation.OptionalConfigurationComponent; //导入依赖的package包/类
@Override
@JsonIgnore
public Map<String, OptionalConfigurationComponent<?>> getValidationMap() {
// Use getDeclaredFields as the fields will probably be private
final Field[] fields = getClass().getDeclaredFields();
final Map<String, OptionalConfigurationComponent<?>> result = new HashMap<>();
for (final Field field : fields) {
final boolean oldValue = field.isAccessible();
try {
field.setAccessible(true);
final Object o = field.get(this);
// if o is null this is false
if (o instanceof OptionalConfigurationComponent) {
final JsonProperty ann = field.getAnnotation(JsonProperty.class);
final String key;
if (ann != null) {
key = ann.value();
}
else {
key = field.getName();
}
result.put(key, (OptionalConfigurationComponent<?>) o);
}
} catch (final IllegalAccessException e) {
throw new AssertionError("Your JVM does not allow you to run this code.", e);
} finally {
//noinspection ThrowFromFinallyBlock
field.setAccessible(oldValue);
}
}
return result;
}
示例4: testGetValidationMap
import com.hp.autonomy.frontend.configuration.validation.OptionalConfigurationComponent; //导入依赖的package包/类
@Test
public void testGetValidationMap() {
final Map<String, OptionalConfigurationComponent<?>> map = concreteConfig.getValidationMap();
assertThat(map.keySet(), hasSize(3));
assertEquals(host, map.get("host"));
assertEquals(port, map.get("port"));
assertEquals(cake, map.get("cake"));
}
示例5: testGetEnabledValidationMap
import com.hp.autonomy.frontend.configuration.validation.OptionalConfigurationComponent; //导入依赖的package包/类
@Test
public void testGetEnabledValidationMap() {
final Map<String, OptionalConfigurationComponent<?>> map = concreteConfig.getEnabledValidationMap();
assertThat(map.keySet(), hasSize(1));
assertThat(map.get("host"), is(nullValue()));
assertThat(map.get("port"), is(nullValue()));
assertEquals(cake, map.get("cake"));
}
示例6: validate
import com.hp.autonomy.frontend.configuration.validation.OptionalConfigurationComponent; //导入依赖的package包/类
@Override
public ValidationResult<?> validate(final OptionalConfigurationComponent<?> configurationComponent) {
throw new UnsupportedOperationException("This service doesn't support component validation");
}
示例7: isOptionalComponentEnabled
import com.hp.autonomy.frontend.configuration.validation.OptionalConfigurationComponent; //导入依赖的package包/类
private <T extends OptionalConfigurationComponent<T>> Boolean isOptionalComponentEnabled(final OptionalConfigurationComponent<T> maybeComponent) {
return Optional.ofNullable(maybeComponent)
.map(component -> BooleanUtils.isTrue(component.getEnabled()))
.orElse(false);
}
示例8: getEnabledValidationMap
import com.hp.autonomy.frontend.configuration.validation.OptionalConfigurationComponent; //导入依赖的package包/类
@Override
public Map<String, OptionalConfigurationComponent<?>> getEnabledValidationMap() {
return null;
}
示例9: getValidationMap
import com.hp.autonomy.frontend.configuration.validation.OptionalConfigurationComponent; //导入依赖的package包/类
@Override
public Map<String, OptionalConfigurationComponent<?>> getValidationMap() {
return null;
}
示例10: getValidationMap
import com.hp.autonomy.frontend.configuration.validation.OptionalConfigurationComponent; //导入依赖的package包/类
/**
* Returns a representation of this config as a Map, suitable for use with a {@link ValidationService}.
*
* @return A map representation of this config.
*/
Map<String, OptionalConfigurationComponent<?>> getValidationMap();
示例11: getEnabledValidationMap
import com.hp.autonomy.frontend.configuration.validation.OptionalConfigurationComponent; //导入依赖的package包/类
/**
* Returns a representation of this config as a Map, suitable for use with a {@link ValidationService}.
*
* @return A map representation of the enabled components of this config.
*/
Map<String, OptionalConfigurationComponent<?>> getEnabledValidationMap();