Example usage for com.google.common.collect ImmutableMap values

List of usage examples for com.google.common.collect ImmutableMap values

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableMap values.

Prototype

public ImmutableCollection<V> values() 

Source Link

Usage

From source file:com.facebook.buck.remoteexecution.event.listener.RemoteExecutionConsoleLineProvider.java

private boolean hasFirstRemoteActionStarted(ImmutableMap<State, Integer> actionsPerState) {
    return actionsPerState.values().stream().reduce((a, b) -> a + b).get() > 0;
}

From source file:pl.itrack.client.shared.services.TristarDataService.java

public List<TristarObject> getAllCameras() {
    ImmutableMap<Integer, TristarObject> camerasMap = camerasDataSet.fetchAll(TristarObjectType.CAMERA);
    return camerasMap.values().asList();
}

From source file:org.elasticsearch.common.blobstore.support.AbstractBlobContainer.java

@Override
public void deleteBlobsByFilter(BlobNameFilter filter) throws IOException {
    ImmutableMap<String, BlobMetaData> blobs = listBlobs();
    for (BlobMetaData blob : blobs.values()) {
        if (filter.accept(blob.name())) {
            deleteBlob(blob.name());//from ww w .  ja  v a2 s.c  o  m
        }
    }
}

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

private static NativeLinkableInput getSharedLibraryNativeLinkTargetInput(BuildRuleParams params,
        BuildRuleResolver ruleResolver, SourcePathResolver pathResolver, SourcePathRuleFinder ruleFinder,
        CxxBuckConfig cxxBuckConfig, CxxPlatform cxxPlatform, Arg arg, ImmutableList<String> linkerFlags,
        ImmutableList<String> exportedLinkerFlags, ImmutableSet<FrameworkPath> frameworks,
        ImmutableSet<FrameworkPath> libraries) throws NoSuchBuildTargetException {

    // Create rules for compiling the PIC object files.
    ImmutableMap<CxxPreprocessAndCompile, SourcePath> objects = CxxDescriptionEnhancer.requireObjects(params,
            ruleResolver, pathResolver, ruleFinder, cxxBuckConfig, cxxPlatform,
            CxxSourceRuleFactory.PicType.PIC, arg);

    return NativeLinkableInput.builder()
            .addAllArgs(FluentIterable.from(linkerFlags).append(exportedLinkerFlags)
                    .transform(MacroArg.toMacroArgFunction(MACRO_HANDLER, params.getBuildTarget(),
                            params.getCellRoots(), ruleResolver)))
            .addAllArgs(SourcePathArg.from(pathResolver, objects.values())).setFrameworks(frameworks)
            .setLibraries(libraries).build();
}

From source file:org.sonar.java.checks.HiddenFieldCheck.java

private void isVariableHidingField(VariableTree variableTree) {
    for (ImmutableMap<String, VariableTree> variables : fields) {
        if (variables.values().contains(variableTree)) {
            return;
        }//from ww  w  .j  a  v  a  2 s.c om
        String identifier = variableTree.simpleName().name();
        VariableTree hiddenVariable = variables.get(identifier);
        if (!flattenExcludedVariables.contains(variableTree) && hiddenVariable != null
                && !isInStaticInnerClass(hiddenVariable, variableTree)) {
            int line = hiddenVariable.firstToken().line();
            reportIssue(variableTree.simpleName(),
                    "Rename \"" + identifier + "\" which hides the field declared at line " + line + ".");
            return;
        }
    }
}

From source file:org.grycap.gpf4med.TemplateManager.java

public ImmutableCollection<Template> listTemplates() {
    final ImmutableMap<String, Template> templates = templates(null);
    return templates != null ? templates.values() : new ImmutableList.Builder<Template>().build();
}

From source file:org.grycap.gpf4med.TemplateManager.java

public ImmutableCollection<Template> listTemplates(String idOntology) {
    final ImmutableMap<String, Template> templates = templates(idOntology);
    return templates != null ? templates.values() : new ImmutableList.Builder<Template>().build();
}

From source file:org.elasticsearch.common.blobstore.support.AbstractBlobContainer.java

@Override
public ImmutableMap<String, BlobMetaData> listBlobsByPrefix(String blobNamePrefix) throws IOException {
    ImmutableMap<String, BlobMetaData> allBlobs = listBlobs();
    ImmutableMap.Builder<String, BlobMetaData> blobs = ImmutableMap.builder();
    for (BlobMetaData blob : allBlobs.values()) {
        if (blob.name().startsWith(blobNamePrefix)) {
            blobs.put(blob.name(), blob);
        }// w w w  .  j a  v  a  2 s. co  m
    }
    return blobs.build();
}

From source file:com.facebook.buck.skylark.parser.RuleFunctionFactory.java

/**
 * Validates attributes passed to the rule and in case any required attribute is not provided,
 * throws an {@link IllegalArgumentException}.
 *
 * @param kwargs The keyword arguments passed to the rule.
 * @param allParamInfo The mapping from build rule attributes to their information.
 * @param name The build rule name. (e.g. {@code java_library}).
 * @param ast The abstract syntax tree of the build rule function invocation.
 *//*www.  j a v  a 2  s  .c o  m*/
private void throwOnMissingRequiredAttribute(Map<String, Object> kwargs,
        ImmutableMap<String, ParamInfo> allParamInfo, String name, FuncallExpression ast) throws EvalException {
    ImmutableList<ParamInfo> missingAttributes = allParamInfo.values().stream()
            .filter(param -> !param.isOptional() && !kwargs.containsKey(param.getPythonName()))
            .collect(ImmutableList.toImmutableList());
    if (!missingAttributes.isEmpty()) {
        throw new EvalException(ast.getLocation(),
                name + " requires "
                        + missingAttributes.stream().map(ParamInfo::getPythonName)
                                .collect(Collectors.joining(" and "))
                        + " but they are not provided.",
                BUCK_RULE_DOC_URL_PREFIX + name);
    }
}

From source file:com.facebook.buck.rules.coercer.DefaultConstructorArgMarshaller.java

@CheckReturnValue
@Override//from w  w w. j  ava  2  s .co  m
public <T> T populate(CellPathResolver cellRoots, ProjectFilesystem filesystem, BuildTarget buildTarget,
        Class<T> dtoClass, ImmutableSet.Builder<BuildTarget> declaredDeps, Map<String, ?> instance)
        throws ParamInfoException {
    Pair<Object, Function<Object, T>> dtoAndBuild = CoercedTypeCache.instantiateSkeleton(dtoClass, buildTarget);
    ImmutableMap<String, ParamInfo> allParamInfo = CoercedTypeCache.INSTANCE.getAllParamInfo(typeCoercerFactory,
            dtoClass);
    for (ParamInfo info : allParamInfo.values()) {
        info.setFromParams(cellRoots, filesystem, buildTarget, buildTarget.getTargetConfiguration(),
                dtoAndBuild.getFirst(), instance);
    }
    T dto = dtoAndBuild.getSecond().apply(dtoAndBuild.getFirst());
    collectDeclaredDeps(cellRoots, allParamInfo.get("deps"), declaredDeps, dto);
    return dto;
}