Example usage for com.google.common.collect Constraint equals

List of usage examples for com.google.common.collect Constraint equals

Introduction

In this page you can find the example usage for com.google.common.collect Constraint equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:org.sonar.javascript.se.SeVerifier.java

private boolean findCorresponding(ProgramState actualPs, Map<ProgramState, Boolean> expectedProgramStates) {
    for (ProgramState expectedPs : expectedProgramStates.keySet()) {

        // fixme(Lena) : do we want to check here only ones that are not checked before?
        boolean allExpectedSymbolsMatched = true;
        for (Symbol expectedSymbol : expectedPs.values().keySet()) {
            Constraint actualSymbolicValue = actualPs.getConstraint(expectedSymbol);
            if (actualSymbolicValue == null
                    || !actualSymbolicValue.equals(expectedPs.getConstraint(expectedSymbol))) {
                allExpectedSymbolsMatched = false;
                break;
            }// w  w  w  .java 2 s. c om
        }
        if (allExpectedSymbolsMatched) {
            expectedProgramStates.put(expectedPs, true);
            return true;
        }

    }
    return false;
}

From source file:com.google.devtools.build.lib.packages.RequiredProviders.java

private RequiredProviders(Constraint constraint, ImmutableList<ImmutableSet<Class<?>>> nativeProviders,
        ImmutableList<ImmutableSet<SkylarkProviderIdentifier>> skylarkProviders) {
    this.constraint = constraint;

    Preconditions.checkState(constraint.equals(Constraint.RESTRICTED)
            || (nativeProviders.isEmpty() && skylarkProviders.isEmpty()));

    this.nativeProviders = nativeProviders;
    this.skylarkProviders = skylarkProviders;
}