Example usage for com.google.common.collect ImmutableSortedSet copyOf

List of usage examples for com.google.common.collect ImmutableSortedSet copyOf

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableSortedSet copyOf.

Prototype

public static <E extends Comparable<? super E>> ImmutableSortedSet<E> copyOf(E[] elements) 

Source Link

Usage

From source file:google.registry.util.CollectionUtils.java

/** Defensive copy helper for {@link Set}. */
public static <V extends Comparable<V>> ImmutableSortedSet<V> nullToEmptyImmutableSortedCopy(Set<V> data) {
    return data == null ? ImmutableSortedSet.<V>of() : ImmutableSortedSet.copyOf(data);
}

From source file:com.facebook.buck.cxx.CxxBinary.java

public CxxBinary(BuildRuleParams params, BuildRuleResolver ruleResolver, SourcePathResolver resolver,
        SourcePathRuleFinder ruleFinder, BuildRule linkRule, Tool executable,
        Iterable<FrameworkPath> frameworks, Iterable<BuildTarget> tests, BuildTarget platformlessTarget) {
    super(params, resolver);
    this.params = params;
    this.ruleResolver = ruleResolver;
    this.ruleFinder = ruleFinder;
    this.linkRule = linkRule;
    this.executable = executable;
    this.tests = ImmutableSortedSet.copyOf(tests);
    this.frameworks = ImmutableSortedSet.copyOf(frameworks);
    this.platformlessTarget = platformlessTarget;
    performChecks();/*from ww w  .jav  a2s .  c  om*/
}

From source file:com.facebook.buck.jvm.java.CalculateClassAbi.java

public static CalculateClassAbi of(BuildTarget target, SourcePathRuleFinder ruleFinder,
        ProjectFilesystem projectFilesystem, BuildRuleParams libraryParams, SourcePath library,
        AbiGenerationMode compatibilityMode) {
    return new CalculateClassAbi(target, projectFilesystem,
            libraryParams.withDeclaredDeps(ImmutableSortedSet.copyOf(ruleFinder.filterBuildRuleInputs(library)))
                    .withoutExtraDeps(),
            library, compatibilityMode);
}

From source file:com.opengamma.strata.collect.named.EnumNames.java

private EnumNames(Class<T> enumType, boolean manualToString) {
    ArgChecker.notNull(enumType, "enumType");
    SortedMap<String, T> map = new TreeMap<>();
    SortedSet<String> formattedSet = new TreeSet<>();
    EnumMap<T, String> formatMap = new EnumMap<>(enumType);
    for (T value : enumType.getEnumConstants()) {
        String formatted = manualToString ? value.toString()
                : CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, value.name());
        map.put(value.name(), value);//from  w  w w .j  a v  a2s  .c om
        map.put(value.name().toUpperCase(Locale.ENGLISH), value);
        map.put(value.name().toLowerCase(Locale.ENGLISH), value);
        map.put(formatted, value);
        map.put(formatted.toUpperCase(Locale.ENGLISH), value);
        map.put(formatted.toLowerCase(Locale.ENGLISH), value);
        formattedSet.add(formatted);
        formatMap.put(value, formatted);
    }
    this.parseMap = ImmutableSortedMap.copyOf(map);
    this.formattedSet = ImmutableSortedSet.copyOf(formattedSet);
    this.formatMap = formatMap;
}

From source file:io.wcm.devops.conga.resource.ClasspathResourceCollectionImpl.java

@Override
public SortedSet<Resource> getResources() {
    return ImmutableSortedSet.copyOf(fileUrls.stream()
            .map(url -> new ClasspathResourceImpl(url, resourceLoader)).collect(Collectors.toList()));
}

From source file:se.sics.caracaldb.global.SchemaData.java

public ImmutableSortedSet<String> schemas() {
    return ImmutableSortedSet.copyOf(schemaIDs.keySet());
}

From source file:com.facebook.buck.android.AndroidManifest.java

protected AndroidManifest(BuildTarget buildTarget, SourcePath skeletonFile, Set<Path> manifestFiles) {
    this.buildTarget = Preconditions.checkNotNull(buildTarget);
    this.skeletonFile = Preconditions.checkNotNull(skeletonFile);
    this.manifestFiles = ImmutableSortedSet.copyOf(manifestFiles);
    this.pathToOutputFile = Paths.get(BuckConstant.GEN_DIR, buildTarget.getBasePath(),
            "AndroidManifest__" + buildTarget.getShortName() + "__.xml");
}

From source file:com.google.gerrit.testutil.InMemoryRepositoryManager.java

@Override
public SortedSet<Project.NameKey> list() {
    SortedSet<Project.NameKey> names = Sets.newTreeSet();
    for (DfsRepository repo : repos.values()) {
        names.add(new Project.NameKey(repo.getDescription().getRepositoryName()));
    }/*w w  w.  j  a  v a 2s. c  om*/
    return ImmutableSortedSet.copyOf(names);
}

From source file:com.proofpoint.configuration.ConfigurationFactory.java

public Set<String> getUsedProperties() {
    return ImmutableSortedSet.copyOf(usedProperties);
}

From source file:com.facebook.buck.jvm.java.AnnotationProcessingParams.java

private AnnotationProcessingParams(@Nullable BuildTarget ownerTarget, @Nullable ProjectFilesystem filesystem,
        Set<Path> searchPathElements, Set<String> names, Set<String> parameters,
        ImmutableSortedSet<SourcePath> inputs, boolean processOnly) {
    this.ownerTarget = ownerTarget;
    this.filesystem = filesystem;
    this.searchPathElements = ImmutableSortedSet.copyOf(searchPathElements);
    this.names = ImmutableSortedSet.copyOf(names);
    this.parameters = ImmutableSortedSet.copyOf(parameters);
    this.inputs = inputs;
    this.processOnly = processOnly;

    if (!isEmpty() && ownerTarget != null) {
        Preconditions.checkNotNull(filesystem);
    }//from w  w w. j av  a 2s. c om
}