当前位置: 首页>>代码示例>>Java>>正文


Java OptionalConfigurationComponent类代码示例

本文整理汇总了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;
}
 
开发者ID:hpe-idol,项目名称:java-configuration-impl,代码行数:18,代码来源:AbstractConfig.java

示例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;
}
 
开发者ID:hpe-idol,项目名称:find,代码行数:9,代码来源:IdolFindConfig.java

示例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;
}
 
开发者ID:hpe-idol,项目名称:java-configuration-impl,代码行数:39,代码来源:AbstractConfig.java

示例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"));
}
 
开发者ID:hpe-idol,项目名称:java-configuration-impl,代码行数:11,代码来源:AbstractConfigTest.java

示例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"));
}
 
开发者ID:hpe-idol,项目名称:java-configuration-impl,代码行数:11,代码来源:AbstractConfigTest.java

示例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");
}
 
开发者ID:hpe-idol,项目名称:find,代码行数:5,代码来源:AssetValidationService.java

示例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);
}
 
开发者ID:hpe-idol,项目名称:find,代码行数:6,代码来源:IdolFindConfig.java

示例8: getEnabledValidationMap

import com.hp.autonomy.frontend.configuration.validation.OptionalConfigurationComponent; //导入依赖的package包/类
@Override
public Map<String, OptionalConfigurationComponent<?>> getEnabledValidationMap() {
    return null;
}
 
开发者ID:hpe-idol,项目名称:find,代码行数:5,代码来源:MockConfig.java

示例9: getValidationMap

import com.hp.autonomy.frontend.configuration.validation.OptionalConfigurationComponent; //导入依赖的package包/类
@Override
public Map<String, OptionalConfigurationComponent<?>> getValidationMap() {
    return null;
}
 
开发者ID:hpe-idol,项目名称:find,代码行数:5,代码来源:MockConfig.java

示例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();
 
开发者ID:hpe-idol,项目名称:java-configuration-impl,代码行数:7,代码来源:Config.java

示例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();
 
开发者ID:hpe-idol,项目名称:java-configuration-impl,代码行数:7,代码来源:Config.java


注:本文中的com.hp.autonomy.frontend.configuration.validation.OptionalConfigurationComponent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。