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:com.ge.predix.acs.policy.evaluation.cache.InMemoryPolicyEvaluationCache.java

@Override
List<Object> multiGetResourceTranslations(final List<String> fromKeys) {
    List<Object> result = new ArrayList<>();
    for (String fromKey : fromKeys) {
        Set<String> toKeys = this.resourceTranslations.get(fromKey);
        if (null == toKeys) {
            toKeys = Collections.emptySet();
        }//from   w w w . j  a  v a2 s.  co  m
        result.add(toKeys);
    }
    return result;
}

From source file:io.cloudslang.lang.compiler.modeller.model.Executable.java

protected Executable(Map<String, Serializable> preExecActionData, Map<String, Serializable> postExecActionData,
        String namespace, String name, List<Input> inputs, List<Output> outputs, List<Result> results,
        Set<String> executableDependencies, Set<String> systemPropertyDependencies) {
    this.preExecActionData = preExecActionData;
    this.postExecActionData = postExecActionData;
    this.namespace = namespace;
    this.name = name;
    this.inputs = inputs;
    this.outputs = outputs;
    this.results = results;
    this.executableDependencies = executableDependencies;
    this.externalExecutableDependencies = Collections.emptySet();
    this.systemPropertyDependencies = systemPropertyDependencies;
    this.id = namespace + Regex.NAMESPACE_PROPERTY_DELIMITER + name;
}

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

/**
 * @return the adapter list./*from w w w . j av a  2  s .  co m*/
 */
public Collection<AbstractRosAdapter> getAdapterList() {
    if (deviceDetailLinkContext == null) {
        return Collections.emptySet();
    }

    Device device = qm.findDeviceByTopicRoot(deviceDetailLinkContext);
    if (device == null) {
        return Collections.emptySet();
    }

    return nodeService.getAdapterNodes().get(device.getTopicRoot());
}

From source file:com.mirth.connect.server.api.servlets.ChannelStatusServlet.java

@Override
public DashboardChannelInfo getDashboardChannelInfo(int fetchSize) {
    // Return a partial dashboard status list, and a list of remaining channel IDs
    Set<String> remainingChannelIds = engineController.getDeployedIds();

    Set<String> channelIds;
    if (remainingChannelIds.size() > fetchSize) {
        channelIds = new HashSet<String>(fetchSize);

        for (Iterator<String> it = remainingChannelIds.iterator(); it.hasNext()
                && channelIds.size() < fetchSize;) {
            channelIds.add(it.next());/*from   w  w w  .java2s .c o  m*/
            it.remove();
        }
    } else {
        channelIds = remainingChannelIds;
        remainingChannelIds = Collections.emptySet();
    }

    List<DashboardStatus> channelStatuses = engineController.getChannelStatusList(redactChannelIds(channelIds));
    return new DashboardChannelInfo(channelStatuses, remainingChannelIds);
}

From source file:nu.yona.server.goals.service.ActivityCategoryServiceTestConfiguration.java

@Before
public void setUpPerTest() {
    LocaleContextHolder.setLocale(Translator.EN_US_LOCALE);
    gambling = ActivityCategory.createInstance(UUID.randomUUID(), usString("gambling"), false,
            new HashSet<>(Arrays.asList("poker", "lotto")), Collections.emptySet(), usString("Descr"));
    news = ActivityCategory.createInstance(UUID.randomUUID(), usString("news"), false,
            new HashSet<>(Arrays.asList("refdag", "bbc")), Collections.emptySet(), usString("Descr"));

    mockRepositoryFindAllResult = new ArrayList<>();
    mockRepositoryFindAllResult.add(gambling);
    mockRepositoryFindAllResult.add(news);

    JUnitUtil.setUpRepositoryMock(mockRepository);
    when(mockRepository.findAll()).thenReturn(Collections.unmodifiableList(mockRepositoryFindAllResult));
    when(mockRepository.findOne(gambling.getId())).thenReturn(gambling);
    when(mockRepository.findOne(news.getId())).thenReturn(news);

    ActivityCategoryServiceTestConfiguration.mockActivityCategorySetCache.clear();
}

From source file:fr.ritaly.dungeonmaster.ai.CreatureManager.java

/**
 * Returns the creatures occupying this position as a set.
 *
 * @return a set of creatures. Never returns null.
 *///ww  w .j av  a  2 s. c o  m
public final Set<Creature> getCreatures() {
    if (creatures == null) {
        return Collections.emptySet();
    }

    // Using a set will remove the double entries (1 creature can occupy
    // several sectors).
    return new HashSet<Creature>(creatures.values());
}

From source file:gda.data.scan.datawriter.scannablewriter.StringComponentWriter.java

@Override
public Collection<SelfCreatingLink> makeComponent(final NeXusFileInterface file, int[] dim, final String path,
        final String scannableName, final String componentName, final Object pos, final String unit)
        throws NexusException {

    final String name = enterLocation(file, path);

    stringlength = 127;/*from   ww w .  j a  v  a 2  s .  c o m*/

    final Object slab = getComponentSlab(pos);
    final int slablength = Array.getLength(slab);

    if (Arrays.equals(dim, new int[] { 1 })) {
        stringlength = slablength;
    } else if (slablength + 10 > stringlength) { // if strings vary more than that we are in trouble
        stringlength = slablength + 10;
    }

    dim = makedatadimfordim(dim);

    if (dim[dim.length - 1] == 1) {
        dim[dim.length - 1] = stringlength;
    } else {
        dim = ArrayUtils.add(dim, stringlength);
    }
    rank = dim.length;

    file.makedata(name, NexusFile.NX_CHAR, rank, dim);
    file.opendata(name);

    if (componentName != null) {
        file.putattr("local_name", (scannableName + "." + componentName).getBytes(UTF8), NexusFile.NX_CHAR);
    }

    addCustomAttributes(file, scannableName, componentName);
    file.putslab(slab, nulldimfordim(dim), slabsizedimfordim(dim));

    file.closedata();
    leaveLocation(file);

    return Collections.emptySet();
}

From source file:org.n52.iceland.binding.json.JSONBinding.java

@Override
public Set<String> getConformanceClasses(String service, String version) {
    if (SosConstants.SOS.equals(service) && Sos2Constants.SERVICEVERSION.equals(version)) {
        return Collections.unmodifiableSet(CONFORMANCE_CLASSES);
    }/*from w w w . j  a v  a2 s  . c o  m*/
    return Collections.emptySet();
}

From source file:org.apache.syncope.core.persistence.beans.AbstractBaseBean.java

/**
 * @return fields to be excluded when computing equals() or hashcode()
 *//*from   w  w w  . j  a va2  s . c o m*/
private String[] getExcludeFields() {
    Set<String> excludeFields = new HashSet<String>();

    PropertyDescriptor[] propertyDescriptors = BeanUtils.getPropertyDescriptors(getClass());
    for (int i = 0; i < propertyDescriptors.length; i++) {

        if (propertyDescriptors[i].getPropertyType().isInstance(Collections.emptySet())
                || propertyDescriptors[i].getPropertyType().isInstance(Collections.emptyList())) {

            excludeFields.add(propertyDescriptors[i].getName());
        }
    }

    return excludeFields.toArray(new String[] {});
}

From source file:io.gravitee.gateway.services.sync.SyncManagerTest.java

@Test
public void test_empty() throws TechnicalException {
    when(apiRepository.findAll()).thenReturn(Collections.emptySet());

    syncManager.refresh();//  w  w w .  j  a v  a  2 s  . co m

    verify(apiManager, never()).deploy(any(Api.class));
    verify(apiManager, never()).update(any(Api.class));
    verify(apiManager, never()).undeploy(any(String.class));
}