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:me.lucko.luckperms.data.Log.java

public Log(SortedSet<LogEntry> content) {
    this.content = ImmutableSortedSet.copyOf(content);
}

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

@Override
public RuleKeyBuilder appendToRuleKey(RuleKeyBuilder builder) {
    for (Path path : ImmutableSortedSet.copyOf(getNameToPathMap().keySet())) {
        SourcePath source = getNameToPathMap().get(path);
        builder.setReflectively("include(" + path.toString() + ")", source);
    }/*from  www.  j a v a 2s  .c  o m*/

    return builder;
}

From source file:com.opengamma.financial.security.cds.CDSIndexTerms.java

/**
 * Obtains an {@link CDSIndexTerms} from a collection of tenors.
 * //w  w  w. j av  a 2  s  . c o  m
 * @param tenors  the collection of tenors, validated
 * @return the cdsIndex terms, not null
 */
private static CDSIndexTerms create(Iterable<Tenor> tenors) {
    return new CDSIndexTerms(ImmutableSortedSet.copyOf(tenors));
}

From source file:org.gradle.api.internal.changedetection.state.AbstractTaskExecution.java

@Override
public ImmutableSortedSet<String> getOutputPropertyNamesForCacheKey() {
    return ImmutableSortedSet.copyOf(outputPropertyNamesForCacheKey);
}

From source file:com.spotify.heroic.suggest.TagSuggest.java

public static Collector<TagSuggest, TagSuggest> reduce(final OptionalLimit limit) {
    return groups -> {
        final List<RequestError> errors1 = new ArrayList<>();
        final Map<Pair<String, String>, Float> suggestions1 = new HashMap<>();

        for (final TagSuggest g : groups) {
            errors1.addAll(g.errors);// w  w w .  ja  v a2s  . co m

            for (final Suggestion s : g.suggestions) {
                final Pair<String, String> key = Pair.of(s.getKey(), s.getValue());
                final Float old = suggestions1.put(key, s.getScore());

                // prefer higher score if available.
                if (old != null && s.score < old) {
                    suggestions1.put(key, old);
                }
            }
        }

        final List<Suggestion> values = ImmutableList.copyOf(ImmutableSortedSet.copyOf(suggestions1.entrySet()
                .stream().map(e -> new Suggestion(e.getValue(), e.getKey().getLeft(), e.getKey().getRight()))
                .iterator()));

        return new TagSuggest(errors1, limit.limitList(values));
    };
}

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

JarBackedJavac(String compilerClassName, Iterable<SourcePath> classpath) {
    this.compilerClassName = compilerClassName;
    this.classpath = ImmutableSortedSet.copyOf(classpath);
}

From source file:com.facebook.buck.apple.FatBinary.java

public FatBinary(BuildRuleParams buildRuleParams, SourcePathResolver resolver, Tool lipo,
        SortedSet<SourcePath> thinBinaries, Path output) {
    super(buildRuleParams, resolver);
    this.lipo = lipo;
    this.thinBinaries = ImmutableSortedSet.copyOf(thinBinaries);
    this.output = output;
}

From source file:com.facebook.buck.parcelable.GenParcelableRule.java

private GenParcelableRule(CachingBuildRuleParams cachingBuildRuleParams, Set<String> srcs) {
    super(cachingBuildRuleParams);
    this.srcs = ImmutableSortedSet.copyOf(srcs);

    this.outputDirectory = String.format("%s/%s/__%s__", BuckConstant.GEN_DIR,
            cachingBuildRuleParams.getBuildTarget().getBasePath(),
            cachingBuildRuleParams.getBuildTarget().getShortName());
}

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

@Override
public SortedSet<Resource> getResources() {
    if (!exists()) {
        return ImmutableSortedSet.of();
    }/*from   ww w.j  av a 2s. c om*/
    return ImmutableSortedSet.copyOf(Arrays.stream(file.listFiles()).filter(child -> child.isFile())
            .map(child -> new FileResourceImpl(child)).collect(Collectors.toList()));
}

From source file:io.github.mywarp.mywarp.bukkit.util.permission.BundleProvider.java

/**
 * Creates an instance.//ww  w.j a  v a2  s  . c  o  m
 *
 * @param configuredBundles the configured bundles checked via permission
 * @param defaultBundle     the default bundle returned when none of the configured bundles is applicable
 */
public BundleProvider(Iterable<B> configuredBundles, B defaultBundle) {
    this.configuredBundles = ImmutableSortedSet.copyOf(configuredBundles);
    this.defaultBundle = defaultBundle;

    for (B bundle : configuredBundles) {
        BukkitPermissionsRegistration.INSTANCE
                .register(new Permission(bundle.getPermission(), PermissionDefault.FALSE));
    }
}