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:org.polymap.kaps.ui.filter.KapsEntityFilter.java

@Override
protected Id buildFidFilter(Query<? extends Entity> entities, int maxResults) {
    if (entities == null) {
        return ff.id(Collections.EMPTY_SET);
    } else {//from w  ww .  ja  v a2s  . c o  m
        return super.buildFidFilter(entities, maxResults);
    }
}

From source file:org.hyperledger.fabric.sdk.NetworkConfig.java

/**
 * Names of EventHubs found/*from  w w w  .  ja v  a2  s  .  c  o m*/
 *
 * @return Collection of eventhubs names found.
 */

public Collection<String> getEventHubNames() {
    if (eventHubs == null) {
        return Collections.EMPTY_SET;
    } else {
        return new HashSet<>(eventHubs.keySet());
    }
}

From source file:pt.ist.maidSyncher.domain.activeCollab.ACTask.java

private Collection<String> processOtherAssignees(pt.ist.maidSyncher.api.activeCollab.ACTask acTask) {

    boolean somethingChanged = false;
    Set<ACUser> newOtherAssigneesSet = new HashSet<ACUser>();

    Set<Long> otherAssigneesId = acTask.getOtherAssigneesId();

    for (Long userId : otherAssigneesId) {
        ACUser otherAssignee = ACUser.findById(userId);
        newOtherAssigneesSet.add(otherAssignee);
    }/*ww  w.  j av a2  s  . c o  m*/

    //retrieve the old
    HashSet<ACUser> oldSet = new HashSet<ACUser>(getOtherAssigneesSet());

    //now, let's compare
    if (!ObjectUtils.equals(newOtherAssigneesSet, oldSet)) {
        somethingChanged = true;
    }

    //now, let's substitute
    for (ACUser user : getOtherAssigneesSet()) {
        removeOtherAssignees(user);
    }

    for (ACUser user : newOtherAssigneesSet)
        addOtherAssignees(user);
    return somethingChanged
            ? Collections.singleton(getPropertyDescriptorNameAndCheckItExists(acTask, "otherAssigneesId"))
            : Collections.EMPTY_SET;
}

From source file:hr.fer.spocc.grammar.cfg.CfgGrammar.java

public Set<CfgProductionRule<T>> getSubstitutions(Variable<T> variable) {
    if (!this.rulesByVariable.containsKey(variable))
        return Collections.EMPTY_SET;
    return Collections.unmodifiableSet(this.rulesByVariable.getAll(variable));
}

From source file:org.talend.dataquality.statistics.datetime.CustomDateTimePatternManagerTest.java

@Test
public void testInvalidDateNotMatchingCustomPattern() {
    assertFalse(CustomDateTimePatternManager.isDate("6/18/09 21:30 PM",
            Collections.<String>singletonList("m-d-y hh:MM")));
    assertEquals(Collections.EMPTY_SET,
            CustomDateTimePatternManager.replaceByDateTimePattern("6/18/09 21:30 PM", "m-d-y hh:MM"));
}

From source file:ubic.gemma.persistence.service.genome.sequenceAnalysis.AnnotationAssociationDaoImpl.java

@Override
public Collection<AnnotationAssociation> find(Collection<GeneProduct> gps) {
    if (gps.isEmpty())
        //noinspection unchecked
        return Collections.EMPTY_SET;
    //noinspection unchecked
    return this.getSessionFactory().getCurrentSession()
            .createQuery("select b from AnnotationAssociation b join b.geneProduct gp where gp in (:gps)")
            .setParameterList("gps", gps).list();
}

From source file:org.wings.session.MultipartRequest.java

/**
 * Returns the names of all the uploaded files as an Enumeration of
 * Strings.  It returns an empty Enumeration if there are no uploaded
 * files.  Each file name is the name specified by the form, not by
 * the user.// www.j  av a2s  .  c  o m
 *
 * @return the names of all the uploaded files as an Enumeration of Strings
 */
public Iterator getFileNames() {
    if (urlencodedRequest)
        return Collections.EMPTY_SET.iterator();
    return files.keySet().iterator();
}

From source file:org.codehaus.mojo.mrm.impl.maven.MemoryArtifactStore.java

/**
 * {@inheritDoc}//from   ww w .j  a v  a2s . com
 */
public synchronized Set getArtifacts(String groupId, String artifactId, String version) {
    Map artifactMap = (Map) contents.get(groupId);
    Map versionMap = (Map) (artifactMap == null ? null : artifactMap.get(artifactId));
    Map filesMap = (Map) (versionMap == null ? null : versionMap.get(version));

    return new HashSet(filesMap == null ? Collections.EMPTY_SET : filesMap.keySet());
}

From source file:org.cloudfoundry.identity.uaa.scim.bootstrap.ScimGroupBootstrap.java

public void setDefaultUserGroups(Set<String> defaultUserGroups) {
    if (defaultUserGroups == null) {
        defaultUserGroups = Collections.EMPTY_SET;
    }/* w w w  .  j av  a  2s  . co  m*/
    this.defaultUserGroups = defaultUserGroups.stream().collect(collector);

    setCombinedGroups();
}

From source file:it.geosolutions.geostore.services.rest.security.GeoStoreAuthenticationFilter.java

/**
 * Creates a new user with the given//from  w  w w  .  j  a  va2  s  . c o m
 * userName and raw (service retrieved) user details object.
 * 
 * It uses the configured UserMapper to populate user attributes.
 * 
 * The user is assigned the USER role and no groups.
 * 
 * @param userName
 * @param rawUser
 * @return
 * @throws BadRequestServiceEx
 * @throws NotFoundServiceEx
 */
protected User createUser(String userName, String credentials, Object rawUser)
        throws BadRequestServiceEx, NotFoundServiceEx {
    User user = new User();

    user.setName(userName);
    user.setNewPassword(credentials);
    user.setEnabled(enableAutoCreatedUsers);

    Role role = Role.USER;
    user.setRole(role);
    user.setGroups(Collections.EMPTY_SET);
    if (userMapper != null) {
        userMapper.mapUser(rawUser, user);
    }
    if (userService != null) {
        userService.insert(user);
    }
    return user;
}