Example usage for java.util Collections emptySet

List of usage examples for java.util Collections emptySet

Introduction

In this page you can find the example usage for java.util Collections emptySet.

Prototype

@SuppressWarnings("unchecked")
public static final <T> Set<T> emptySet() 

Source Link

Document

Returns an empty set (immutable).

Usage

From source file:edu.internet2.middleware.shibboleth.common.config.security.StaticPKIXX509CredentialTrustEngineFactoryBean.java

/** {@inheritDoc} */
protected Object createInstance() throws Exception {
    Set<String> names = getTrustedNames();
    if (names == null) {
        names = Collections.emptySet();
    }//from w  w  w.ja  v  a 2  s .  c  o  m
    StaticPKIXValidationInformationResolver pkixResolver = new StaticPKIXValidationInformationResolver(
            getPKIXInfo(), names);

    PKIXX509CredentialTrustEngine engine = new PKIXX509CredentialTrustEngine(pkixResolver);

    if (getPKIXValidationOptions() != null) {
        ((CertPathPKIXTrustEvaluator) engine.getPKIXTrustEvaluator())
                .setPKIXValidationOptions(getPKIXValidationOptions());
    }

    return engine;
}

From source file:feign.jackson.JacksonModule.java

@Provides(type = Provides.Type.SET_VALUES)
Set<Module> noDefaultModules() {
    return Collections.emptySet();
}

From source file:org.echocat.marquardt.example.ServiceLoginIntegrationTest.java

private void givenSignedInUser() throws IOException {
    givenExistingUser(Collections.emptySet());
    givenClientIdIsAllowed();//from ww w  .jav a2s  .co m
    givenCorrectCredentials();
    whenSigningIn();
}

From source file:com.hp.autonomy.idol.parametricvalues.IdolParametricValuesService.java

@Override
public Set<QueryTagInfo> getAllParametricValues(final IdolParametricRequest idolParametricRequest)
        throws AciErrorException {
    final Collection<String> fieldNames = new HashSet<>();
    fieldNames.addAll(idolParametricRequest.getFieldNames());
    if (fieldNames.isEmpty()) {
        fieldNames.addAll(getTagNames());
    }//w ww.  j a  v a  2 s . c  o m

    final Set<QueryTagInfo> results;
    if (fieldNames.isEmpty()) {
        results = Collections.emptySet();
    } else {
        final AciParameters aciParameters = new AciParameters(TagActions.GetQueryTagValues.name());
        aciParameters.add(QueryParams.Combine.name(), CombineParam.Simple);
        aciParameters.add(QueryParams.Text.name(), idolParametricRequest.getQueryText());
        aciParameters.add(QueryParams.FieldText.name(), idolParametricRequest.getFieldText());
        aciParameters.add(QueryParams.DatabaseMatch.name(),
                new Databases(idolParametricRequest.getDatabases()));
        aciParameters.add(QueryParams.MinDate.name(), formatDate(idolParametricRequest.getMinDate()));
        aciParameters.add(QueryParams.MaxDate.name(), formatDate(idolParametricRequest.getMaxDate()));
        aciParameters.add(QueryParams.AnyLanguage.name(), true);
        aciParameters.add(GetQueryTagValuesParams.DocumentCount.name(), true);
        aciParameters.add(GetQueryTagValuesParams.MaxValues.name(), MAX_VALUES);
        aciParameters.add(GetQueryTagValuesParams.FieldName.name(),
                StringUtils.join(fieldNames.toArray(), ','));
        aciParameters.add(GetQueryTagValuesParams.Sort.name(), SortParam.DocumentCount.name());

        final GetQueryTagValuesResponseData responseData = contentAciService.executeAction(aciParameters,
                queryTagValuesResponseProcessor);
        final List<FlatField> fields = responseData.getField();
        results = new LinkedHashSet<>(fields.size());
        for (final FlatField field : fields) {
            final List<JAXBElement<? extends Serializable>> valueElements = field.getValueOrSubvalueOrValues();
            final LinkedHashSet<QueryTagCountInfo> values = new LinkedHashSet<>(valueElements.size());
            for (final JAXBElement<?> element : valueElements) {
                if (VALUE_NODE_NAME.equals(element.getName().getLocalPart())) {
                    final TagValue tagValue = (TagValue) element.getValue();
                    values.add(new QueryTagCountInfo(tagValue.getValue(), tagValue.getCount()));
                }
            }
            final String fieldName = getFieldNameFromPath(field.getName().get(0));
            if (!values.isEmpty()) {
                results.add(new QueryTagInfo(fieldName, values));
            }
        }
    }

    return results;
}

From source file:cpcc.commons.pages.ros.RosDeviceDetail.java

/**
 * @param state the state map.// w  w w  .j  a  v  a  2  s. c om
 * @return the parameter list.
 */
private static Collection<String> renderParameterList(Map<String, List<String>> state) {
    if (state == null) {
        return Collections.emptySet();
    }

    Map<String, String> parameterMap = new TreeMap<String, String>();
    for (Entry<String, List<String>> entry : state.entrySet()) {
        parameterMap.put(entry.getKey(), getEntryString(entry.getKey(), entry.getValue()));
    }

    return parameterMap.values();
}

From source file:io.fineo.drill.exec.store.dynamo.DynamoStoragePlugin.java

@Override
public Set<? extends RelOptRule> getOptimizerRules(OptimizerRulesContext optimizerContext, PlannerPhase phase) {
    switch (phase) {
    case PHYSICAL:
        return newHashSet(DynamoPushFilterIntoScan.FILTER_ON_PROJECT, DynamoPushFilterIntoScan.FILTER_ON_SCAN);
    }/*from  www  .j av  a2  s  .  co m*/
    return Collections.emptySet();
}

From source file:edu.wisc.hrs.dao.roles.SoapHrsRolesDao.java

protected Set<String> convertRoles(final GetCompIntfcUWPORTAL1ROLESResponse response) {
    if (response == null) {
        return Collections.emptySet();
    }/*from w  ww. j av  a 2s.c  o  m*/

    final List<UwHrRolUsrVwTypeShape> uwHrRolUsrVws = response.getUwHrRolUsrVws();

    final Set<String> roles = new LinkedHashSet<String>(uwHrRolUsrVws.size());

    for (final UwHrRolUsrVwTypeShape uwHrRolUsrVwTypeShape : uwHrRolUsrVws) {
        final String hrsRoleName = (String) HrsUtils.getValue(uwHrRolUsrVwTypeShape.getRoleName());
        final Set<String> mappedRoleNames = this.hrsRolesMappings.get(hrsRoleName);
        if (mappedRoleNames != null) {
            roles.addAll(mappedRoleNames);
        }
    }

    return roles;
}

From source file:net.ontopia.topicmaps.utils.tmrap.RemoteTopicIndex.java

@Override
public Collection<TopicIF> getTopics(Collection<LocatorIF> indicators, Collection<LocatorIF> sources,
        Collection<LocatorIF> subjects) {

    if (indicators.isEmpty() && sources.isEmpty() && subjects.isEmpty())
        return Collections.emptySet();

    // lookup or create target topic
    TopicMapIF targetTopicMap = storefactory.createStore().getTopicMap();
    TopicIF targetTopic = createTopic(targetTopicMap, indicators, sources, subjects);

    // make sure topic knows it's being loaded
    setLoaded(targetTopic);//from  www  .ja  v a  2s  .co  m

    TopicMapIF sourceTopicMap = new InMemoryTopicMapStore().getTopicMap();
    sourceTopicMap.getStore().setBaseAddress(targetTopicMap.getStore().getBaseAddress());

    // send get-topic request
    try {
        String params = encodeIdentityParameters(indicators, sources, subjects);
        if (tmid != null)
            params = "topicmap=" + tmid + "&" + params;
        loadXTM("get-topic", params, false, sourceTopicMap);
    } catch (IOException e) {
        throw new OntopiaRuntimeException(e);
    }

    TopicIF sourceTopic = findTopic(sourceTopicMap, indicators, sources, subjects);
    TopicMapSynchronizer.update(targetTopicMap, sourceTopic);

    targetTopic = findTopic(targetTopicMap, indicators, sources, subjects);
    return (targetTopic == null ? null : Collections.singleton(targetTopic));
}

From source file:ditl.sim.pnt.DominatingSetConverter.java

@Override
public void seek(long time) throws IOException {
    queue(min_time, Collections.emptySet());
}

From source file:org.openmrs.web.controller.user.RoleFormController.java

/**
 * @see org.springframework.web.servlet.mvc.AbstractFormController#processFormSubmission(javax.servlet.http.HttpServletRequest,
 *      javax.servlet.http.HttpServletResponse, java.lang.Object,
 *      org.springframework.validation.BindException)
 *//*from   w  w w  .java 2  s  . com*/
@SuppressWarnings("unchecked")
protected ModelAndView processFormSubmission(HttpServletRequest request, HttpServletResponse response,
        Object obj, BindException errors) throws Exception {

    Role role = (Role) obj;

    String[] inheritiedRoles = request.getParameterValues("inheritedRoles");
    if (inheritiedRoles == null) {
        role.setInheritedRoles(Collections.EMPTY_SET);
    }

    String[] privileges = request.getParameterValues("privileges");
    if (privileges == null) {
        role.setPrivileges((Set) (Collections.emptySet()));
    }

    return super.processFormSubmission(request, response, role, errors);
}