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.smartitengineering.version.api.impl.CommitImpl.java

/**
 * Get the value of revisions/*from   w ww.j av  a  2  s  .co  m*/
 *
 * @return the value of revisions
 */
public Collection<Revision> getRevisions() {
    if (revisions == null) {
        return Collections.emptySet();
    }
    return revisions;
}

From source file:com.fredhopper.connector.index.provider.FhCategorySource.java

protected Set<ProductModel> findProductFamily(final ProductModel product) {
    if (product instanceof VariantProductModel) {
        // Collect all the variant products and all their super variants, until the final base product is hit
        final Set<ProductModel> products = new HashSet<>();

        ProductModel currentProduct = product;
        while (currentProduct instanceof VariantProductModel) {
            products.add(currentProduct);
            currentProduct = ((VariantProductModel) currentProduct).getBaseProduct();
        }/* w w w  .j a v a2s .c  om*/

        products.add(currentProduct);
        return products;
    } else if (product != null) {
        return Collections.singleton(product);
    }
    return Collections.emptySet();
}

From source file:com.github.nmorel.gwtjackson.client.deser.bean.AbstractBeanJsonDeserializer.java

/**
 * Initialize the {@link Set} containing the ignored property names. Returns an empty set if there are no ignored properties.
 *///from  w w  w . jav a  2 s.  co  m
protected Set<String> initIgnoredProperties() {
    return Collections.emptySet();
}

From source file:edu.northwestern.bioinformatics.studycalendar.web.admin.BaseUserProvisioningCommand.java

protected BaseUserProvisioningCommand(List<PscUser> users,
        ProvisioningSessionFactory provisioningSessionFactory,
        ApplicationSecurityManager applicationSecurityManager) {
    this.users = users;
    this.applicationSecurityManager = applicationSecurityManager;
    this.provisioningSessionFactory = provisioningSessionFactory;

    // locked down by default
    this.provisionableRoles = Collections.emptyList();
    this.provisionableSites = Collections.emptyList();
    this.provisionableRoleGroups = Collections.emptyMap();
    this.provisionableSiteIdentifiers = Collections.emptySet();
    this.provisionableManagedStudies = Collections.emptyList();
    this.provisionableManagedStudyIdentifiers = Collections.emptySet();
    this.provisionableParticipatingStudies = Collections.emptyList();
    this.provisionableParticipatingStudyIdentifiers = Collections.emptySet();
}

From source file:com.manydesigns.portofino.shiro.AbstractPortofinoRealm.java

/**
 * Loads the groups associated to a given user.
 * @param principal the user object./*w  w w  .ja v  a 2  s.com*/
 * @return the groups as a collection of strings.
 */
protected Collection<String> loadAuthorizationInfo(Serializable principal) {
    return Collections.emptySet();
}

From source file:de.tudarmstadt.ukp.dkpro.tc.features.ngram.util.NGramUtils.java

/**
 * Convenience method to return document ngrams when there's no stopword list.
 * //from  ww  w . j  a v  a 2 s.  com
 * @param jcas
 * @param lowerCaseNGrams
 * @param filterPartialMatches
 * @param minN
 * @param maxN
 * @return
 */
public static FrequencyDistribution<String> getDocumentNgrams(JCas jcas, boolean lowerCaseNGrams,
        boolean filterPartialMatches, int minN, int maxN) throws TextClassificationException {
    Set<String> empty = Collections.emptySet();
    return getDocumentNgrams(jcas, lowerCaseNGrams, filterPartialMatches, minN, maxN, empty);
}

From source file:com.agileapes.couteau.maven.resource.ClassPathScanningClassProvider.java

public Set<Class> findCandidateClasses(String basePackage) {
    Set<Class> candidates = new TreeSet<Class>(new Comparator<Class>() {
        @Override/*from   ww  w .jav a2s.com*/
        public int compare(Class dis, Class dat) {
            if (dis == null && dat == null) {
                return 0;
            } else if (dis == null) {
                return -1;
            } else if (dat == null) {
                return 1;
            } else {
                return dis.getName().compareTo(dat.getName());
            }
        }
    });
    try {
        final String packageSearchPath = classpathUrlPrefix + resolveBasePackage(basePackage) + "/"
                + DEFAULT_RESOURCE_PATTERN;
        final Resource[] resources = ((ResourcePatternResolver) this.getResourceLoader())
                .getResources(packageSearchPath);
        if (resources == null) {
            return Collections.emptySet();
        }
        for (Resource resource : resources) {
            if (resource.isReadable() && resource.getURL().getPath() != null) {
                if (isCandidateComponent(this.metadataReaderFactory.getMetadataReader(resource))) {
                    candidates.add(resolveClass(resource, basePackage));
                }
            }
        }
    } catch (IOException ex) {
        throw new RuntimeException("I/O failure during classpath scanning", ex);
    } catch (ClassNotFoundException e) {
        throw new RuntimeException("System failure during classpath scanning. No class were found.", e);
    }
    return candidates;

}

From source file:com.kurtraschke.nyctrtproxy.model.NyctTripId.java

/**
 * Build a NyctTripId from a TripDescriptor
 *
 * This is necessary because route 6X realtime trip IDs have "6" in the typical 'route' position.
 *
 * @param td GTFS-RT TripDescriptor//from  w  w w  .j  a  v  a 2s  .  c  o m
 * @return parsed trip ID
 */
public static NyctTripId buildFromTripDescriptor(GtfsRealtime.TripDescriptorOrBuilder td) {
    return buildFromTripDescriptor(td, Collections.emptySet());
}

From source file:net.sourceforge.fenixedu.domain.ExternalDegreeEnrolment.java

@Override
public Set<IDegreeModuleToEvaluate> getDegreeModulesToEvaluate(ExecutionSemester executionSemester) {
    if (isValid(executionSemester) && isEnroled()) {
        return Collections.<IDegreeModuleToEvaluate>singleton(
                new ExternalDegreeEnrolmentWrapper(this, executionSemester));
    }//from   ww  w.  ja v a 2 s  .c o  m
    return Collections.emptySet();
}

From source file:com.pactera.edg.am.metamanager.extractor.increment.impl.FullIncrementAnalysisServiceImpl.java

/**
 * ???,???,?,??/*w ww  .  j  a v  a 2  s .co m*/
 * 
 * @param aNamespace
 *            ??
 * @return ?(?)
 * @throws MetaModelNotFoundException
 */
private Set<MMMetaModel> genDeleteMetadatas(String aNamespace) throws MetaModelNotFoundException {
    // ??
    List<MMMetadata> dbMetadatas = genMetadataService.genChildrenMetadatasId("%" + aNamespace);
    if (dbMetadatas.size() == 0) {
        // ?,??
        return Collections.emptySet();
    }

    // ??
    Map<String, String> newMetadatas = AdapterExtractorContext.getInstance().getNewMetadatasId();

    // DB??
    Collections.sort(dbMetadatas, new Comparator<MMMetadata>() {
        public int compare(MMMetadata o1, MMMetadata o2) {
            return o1.getClassifierId().compareTo(o2.getClassifierId());
        }
    });

    MMMetaModel deleteMetaModel = null;
    Set<MMMetaModel> deleteMetaModels = new HashSet<MMMetaModel>();
    String metaModelCode = "";
    for (MMMetadata dbMetadata : dbMetadatas) {
        String id = dbMetadata.getId();
        if (!newMetadatas.containsKey(id)) {
            //???????
            if (!AdapterExtractorContext.getInstance().isFileUpload()
                    && cgbPro.get("is_del_codeItem").equals("1")
                    && (dbMetadata.getClassifierId().equals("AmColumnCodeItem")
                            || dbMetadata.getClassifierId().equals("AmCommonCodeItemMapping"))) {
                String parId = genMetadataService.getParId(dbMetadata.getId());
                if (parId != null && newMetadatas.containsKey(parId))
                    continue;
            }
            // ?,,?
            if (metaModelCode.equals("")) {
                // 
                metaModelCode = dbMetadata.getClassifierId();
                deleteMetaModel = genMetaModel(metaModelCode);
            }

            if (!metaModelCode.equals(dbMetadata.getClassifierId())) {
                // ??
                metaModelCode = dbMetadata.getClassifierId();
                deleteMetaModels.add(deleteMetaModel);
                deleteMetaModel = genMetaModel(metaModelCode);
            }
            deleteMetaModel.addMetadata(dbMetadata);
            deleteMetaModel.setHasMetadata(true);
        }
    }

    if (deleteMetaModel != null) {
        deleteMetaModels.add(deleteMetaModel);
    }

    return deleteMetaModels;
}