Example usage for java.util Collections EMPTY_SET

List of usage examples for java.util Collections EMPTY_SET

Introduction

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

Prototype

Set EMPTY_SET

To view the source code for java.util Collections EMPTY_SET.

Click Source Link

Document

The empty set (immutable).

Usage

From source file:com.espertech.esper.core.service.StatementEventTypeRefImpl.java

public Set<String> getStatementNamesForType(String eventTypeName) {
    mapLock.acquireReadLock();//w  ww.  ja v a2 s .  c o  m
    try {
        Set<String> types = typeToStmt.get(eventTypeName);
        if (types == null) {
            return Collections.EMPTY_SET;
        }
        return Collections.unmodifiableSet(types);
    } finally {
        mapLock.releaseReadLock();
    }
}

From source file:org.structr.websocket.command.ListActiveElementsCommand.java

@Override
public void processMessage(WebSocketMessage webSocketData) {

    final SecurityContext securityContext = getWebSocket().getSecurityContext();
    final App app = StructrApp.getInstance(securityContext);
    final String id = webSocketData.getId();

    try (final Tx tx = app.tx()) {

        final Page page = app.get(Page.class, id);
        final List<GraphObject> result = new LinkedList<>();

        if (page != null) {

            collectActiveElements(result, page, Collections.EMPTY_SET, null, 0);

            // set full result list
            webSocketData.setResult(result);
            webSocketData.setRawResultCount(result.size());

            // send only over local connection
            getWebSocket().send(webSocketData, true);

        } else {/*  w  w  w.j av a 2  s . c  o m*/

            getWebSocket().send(
                    MessageBuilder.status().code(404).message("Page with ID " + id + " not found.").build(),
                    true);
        }

    } catch (FrameworkException fex) {

        logger.log(Level.WARNING, "Exception occured", fex);
        getWebSocket().send(MessageBuilder.status().code(fex.getStatus()).message(fex.getMessage()).build(),
                true);
    }
}

From source file:org.apache.openjpa.lib.conf.Value.java

/**
 * Gets the unmodifiable view of the equivalent keys or an empty set if
 * no equivalent key has been added. //from   w w  w .  j ava  2 s  .  c  o m
 * 
 * @since 2.0.0
 */
public Set<String> getEquivalentKeys() {
    return otherNames == null ? Collections.EMPTY_SET : Collections.unmodifiableSet(otherNames);
}

From source file:org.sipfoundry.sipxconfig.imbot.ImBotSettings.java

@Override
public Set<DataSet> getDataSets() {
    return Collections.EMPTY_SET;
}

From source file:com.ctb.service.task.AuthorizationService.java

/**
 * ?????/*from   www  . j  a  v a2 s  . co  m*/
 * 
 * @param username
 * @return
 */
@SuppressWarnings("unchecked")
public Set<String> findPermissions(String appKey, String username) {
    User user = accountService.findUserByLoginName(username);
    if (user == null) {
        return Collections.EMPTY_SET;
    }
    Long appId = appService.findAppIdByAppKey(appKey);
    if (appId == null) {
        return Collections.EMPTY_SET;
    }
    Authorization authorization = authorizationDao.findByAppIdAndUserId(appId, user.getId());
    if (authorization == null) {
        return Collections.EMPTY_SET;
    }
    return roleService.findPermissions(authorization.getRoleIds().toArray(new Long[0]));
}

From source file:org.apache.openjpa.azure.jdbc.conf.AzureConfigurationImpl.java

@Override
public Set<String> getFederatedTables(final String federationName) {
    final Federation fed = federations.get(federationName);
    return fed == null ? Collections.EMPTY_SET : fed.getTables();
}

From source file:com.create.security.oauth2.provider.token.SpringCacheTokenStoreImplTest.java

private OAuth2Authentication createOAuth2Authentication() {
    final OAuth2Request storedRequest = new OAuth2Request(Collections.emptyMap(), CLIENT_ID,
            Collections.<GrantedAuthority>emptyList(), true, Collections.<String>emptySet(),
            Collections.<String>emptySet(), null, Collections.<String>emptySet(),
            Collections.<String, Serializable>emptyMap());
    final User userDetails = new User(USER_NAME, PASSWORD, Collections.EMPTY_SET);
    final Authentication userAuthentication = new UsernamePasswordAuthenticationToken(userDetails, null);
    return new OAuth2Authentication(storedRequest, userAuthentication);
}

From source file:de.hybris.platform.dfcheckoutservice.service.impl.DfDefaultCalculationService.java

private Set<TaxValue> getUnappliedRelativeTaxValues(final Collection<TaxValue> allTaxValues) {
    if (CollectionUtils.isNotEmpty(allTaxValues)) {
        final Set<TaxValue> ret = new LinkedHashSet<TaxValue>(allTaxValues.size());
        for (final TaxValue appliedTv : allTaxValues) {
            if (!appliedTv.isAbsolute()) {
                ret.add(appliedTv.unapply());
            }/*w  w  w.  j  a v  a 2  s. c o m*/
        }
        return ret;
    } else {
        return Collections.EMPTY_SET;
    }
}

From source file:org.eclipse.january.metadata.Metadata.java

@SuppressWarnings("unchecked")
@Override//from   w w  w .  j  av  a 2 s  .co m
public Collection<String> getMetaNames() throws MetadataException {
    return metadata == null ? (Collection<String>) Collections.EMPTY_SET
            : Collections.unmodifiableCollection(metadata.keySet());
}

From source file:com.espertech.esper.core.StatementEventTypeRefImpl.java

public Set<String> getTypesForStatementName(String statementName) {
    mapLock.acquireReadLock();/*  w  w  w. j  a v  a 2s.c o m*/
    try {
        Set<String> types = stmtToType.get(statementName);
        if (types == null) {
            return Collections.EMPTY_SET;
        }
        return Collections.unmodifiableSet(types);
    } finally {
        mapLock.releaseReadLock();
    }
}