/** * Returns an immutable set of the values in this map, in the same order they appear in {@link * #entrySet}. */ @Override public ImmutableSet<V> values() { return inverse().keySet(); }
ScannerSupplierImpl( ImmutableBiMap<String, BugCheckerInfo> checks, ImmutableMap<String, SeverityLevel> severities, ImmutableSet<String> disabled, ErrorProneFlags flags) { checkArgument( Sets.difference(severities.keySet(), checks.keySet()).isEmpty(), "enabledChecks must be a subset of allChecks"); checkArgument( Sets.difference(disabled, checks.keySet()).isEmpty(), "disabled must be a subset of allChecks"); this.checks = checks; this.severities = severities; this.disabled = disabled; this.flags = flags; }
/** Returns the name of the first check, or {@code ""}. */ @Override public String toString() { return getFirst(getAllChecks().keySet(), ""); } }
/** * Returns an immutable set of the values in this map, in the same order they appear in {@link * #entrySet}. */ @Override public ImmutableSet<V> values() { return inverse().keySet(); }
protected Set<String> enabled() { return Sets.difference(getAllChecks().keySet(), disabled()); }
public void testKeySet() { ImmutableBiMap<String, Integer> bimap = ImmutableBiMap.copyOf(ImmutableMap.of("one", 1, "two", 2, "three", 3, "four", 4)); Set<String> keys = bimap.keySet(); assertEquals(Sets.newHashSet("one", "two", "three", "four"), keys); assertThat(keys).containsExactly("one", "two", "three", "four").inOrder(); }
/** * A builder for creating immutable bimap instances, especially {@code public static final} bimaps * ("constant bimaps"). Example: * * <pre>{@code * static final ImmutableBiMap<String, Integer> WORD_TO_INT = * new ImmutableBiMap.Builder<String, Integer>() * .put("one", 1) * .put("two", 2) * .put("three", 3) * .build(); * }</pre> * * <p>For <i>small</i> immutable bimaps, the {@code ImmutableBiMap.of()} methods are even more * convenient. * * <p>By default, a {@code Builder} will generate bimaps that iterate over entries in the order * they were inserted into the builder. For example, in the above example, {@code * WORD_TO_INT.entrySet()} is guaranteed to iterate over the entries in the order {@code "one"=1, * "two"=2, "three"=3}, and {@code keySet()} and {@code values()} respect the same order. If you * want a different order, consider using {@link #orderEntriesByValue(Comparator)}, which changes * this builder to sort entries by value. * * <p>Builder instances can be reused - it is safe to call {@link #build} multiple times to build * multiple bimaps in series. Each bimap is a superset of the bimaps created before it. * * @since 2.0 */ public static final class Builder<K, V> extends ImmutableMap.Builder<K, V> { /**
/** * Returns an immutable set of the values in this map, in the same order they appear in {@link * #entrySet}. */ @Override public ImmutableSet<V> values() { return inverse().keySet(); }
/** * Returns an immutable set of the values in this map. The values are in the * same order as the parameters used to build this map. */ @Override public ImmutableSet<V> values() { return inverse().keySet(); }
/** * Returns an immutable set of the values in this map. The values are in the * same order as the parameters used to build this map. */ @Override public ImmutableSet<V> values() { return inverse().keySet(); }
/** * Returns an immutable set of the values in this map. The values are in the * same order as the parameters used to build this map. */ @Override public ImmutableSet<V> values() { return inverse().keySet(); }
@Override public Enum<?> deserialize(final Object input) { checkArgument(input instanceof String, "Input %s is not a String", input); final Enum<?> value = nameToEnum.get(input); checkArgument(value != null, "Invalid enumeration value %s. Valid values are %s", input, nameToEnum.keySet()); return value; }
/** * Returns an immutable set of the values in this map. The values are in the * same order as the parameters used to build this map. */ @Override public ImmutableSet<V> values() { return inverse().keySet(); }
/** * Returns an immutable set of the values in this map. The values are in the * same order as the parameters used to build this map. */ @Override public ImmutableSet<V> values() { return inverse().keySet(); }
/** * Returns an immutable set of the values in this map. The values are in the * same order as the parameters used to build this map. */ @Override public ImmutableSet<V> values() { return inverse().keySet(); }
@Override public Object deserialize(final Object input) { final Enum<?> value = yangValueToBinding.get(input); Preconditions.checkArgument(value != null, "Invalid enumeration value %s. Valid values are %s", input, yangValueToBinding.keySet()); return value; }
/** * Returns an immutable set of the values in this map. The values are in the * same order as the parameters used to build this map. */ @Override public ImmutableSet<V> values() { return inverse().keySet(); }
/** * Returns an immutable set of the values in this map. The values are in the * same order as the parameters used to build this map. */ @Override public ImmutableSet<V> values() { return inverse().keySet(); }
/** Returns the unboxed type for the given primitive type name, if available; * e.g. {@link Integer#TYPE} for <code>int</code> (distinct from <code>Integer.class</code>), * or null if not a primitive. * */ public static Maybe<Class<?>> getPrimitiveType(String typeName) { if (typeName!=null) { for (Class<?> t: PRIMITIVE_TO_BOXED.keySet()) { if (typeName.equals(t.getName())) return Maybe.<Class<?>>of(t); } } return Maybe.absent("Not a primitive: "+typeName); }
@SubscribeEvent public static void keyPress(KeyInputEvent event) { for (KeyBinding k : ClientKeyHelper.mcToPe.keySet()) { if (k.isPressed()) { PacketHandler.sendToServer(new KeyPressPKT(ClientKeyHelper.mcToPe.get(k))); } } } }