@Override public boolean isEmpty() { return keyIndex.isEmpty(); }
@Override public boolean isEmpty() { return keyIndex.isEmpty(); }
/** Whether this Flags object is empty, i.e. no flags have been set. */ public boolean isEmpty() { return this.flagsMap.isEmpty(); }
@Override public boolean isEmpty() { return keyIndex.isEmpty(); }
/** * Returns a new immutable class-to-instance map containing the entries provided to this * builder. * * @throws IllegalArgumentException if duplicate keys were added */ public ImmutableClassToInstanceMap<B> build() { ImmutableMap<Class<? extends B>, B> map = mapBuilder.build(); if (map.isEmpty()) { return of(); } else { return new ImmutableClassToInstanceMap<B>(map); } } }
Object readResolve() { if (mapOfRanges.isEmpty()) { return of(); } else { return createRangeMap(); } }
@SuppressWarnings("ReferenceEquality") public Set<String> getInvalidatedClasses(ShadowMap previous) { if (this == previous && shadowPickers.isEmpty()) return Collections.emptySet(); Map<String, ShadowInfo> invalidated = new HashMap<>(overriddenShadows); for (Map.Entry<String, ShadowInfo> entry : previous.overriddenShadows.entrySet()) { String className = entry.getKey(); ShadowInfo previousConfig = entry.getValue(); ShadowInfo currentConfig = invalidated.get(className); if (currentConfig == null) { invalidated.put(className, previousConfig); } else if (previousConfig.equals(currentConfig)) { invalidated.remove(className); } } HashSet<String> classNames = new HashSet<>(invalidated.keySet()); classNames.addAll(shadowPickers.keySet()); return classNames; }
Object readResolve() { if (mapOfRanges.isEmpty()) { return of(); } else { return createRangeMap(); } }
StringBuilder toString(StringBuilder b) { b.append(sql); if (!parameters.isEmpty()) { b.append(" {"); int n = 0; for (Map.Entry<String, Value> parameter : parameters.entrySet()) { if (n++ > 0) { b.append(", "); } b.append(parameter.getKey()).append(": "); parameter.getValue().toString(b); } b.append("}"); } return b; } }
Options retainAll(Schema schema, MarkSet markSet) { if (map.isEmpty()) return this; // Nothing to prune. Options result = new Options(optionType, optionElements); Object mapOrNull = retainAll(schema, markSet, optionType, map); result.map = mapOrNull != null ? (ImmutableMap<ProtoMember, Object>) mapOrNull : ImmutableMap.<ProtoMember, Object>of(); return result; }
/** * Returns a new immutable class-to-instance map containing the entries provided to this * builder. * * @throws IllegalArgumentException if duplicate keys were added */ public ImmutableClassToInstanceMap<B> build() { ImmutableMap<Class<? extends B>, B> map = mapBuilder.build(); if (map.isEmpty()) { return of(); } else { return new ImmutableClassToInstanceMap<B>(map); } } }
/** * Returns a new immutable class-to-instance map containing the entries provided to this * builder. * * @throws IllegalArgumentException if duplicate keys were added */ public ImmutableClassToInstanceMap<B> build() { ImmutableMap<Class<? extends B>, B> map = mapBuilder.build(); if (map.isEmpty()) { return of(); } else { return new ImmutableClassToInstanceMap<B>(map); } } }
Object readResolve() { if (mapOfRanges.isEmpty()) { return of(); } else { return createRangeMap(); } }
private void submitLimiterStopMetadataEvents (){ ImmutableMap<String, String> metaData = this.getLimiterStopMetadata(); if (!metaData.isEmpty()) { this.eventSubmitter.submit(LIMITER_STOP_EVENT_NAME, metaData); } }
/** * Returns a multimap view of the map. * * @since 14.0 */ public ImmutableSetMultimap<K, V> asMultimap() { if (isEmpty()) { return ImmutableSetMultimap.of(); } ImmutableSetMultimap<K, V> result = multimapView; return (result == null) ? (multimapView = new ImmutableSetMultimap<>(new MapViewOfValuesAsSingletonSets(), size(), null)) : result; }
/** * Returns a multimap view of the map. * * @since 14.0 */ public ImmutableSetMultimap<K, V> asMultimap() { if (isEmpty()) { return ImmutableSetMultimap.of(); } ImmutableSetMultimap<K, V> result = multimapView; return (result == null) ? (multimapView = new ImmutableSetMultimap<>(new MapViewOfValuesAsSingletonSets(), size(), null)) : result; }
/** * Returns a multimap view of the map. * * @since 14.0 */ public ImmutableSetMultimap<K, V> asMultimap() { if (isEmpty()) { return ImmutableSetMultimap.of(); } ImmutableSetMultimap<K, V> result = multimapView; return (result == null) ? (multimapView = new ImmutableSetMultimap<>(new MapViewOfValuesAsSingletonSets(), size(), null)) : result; }
assertTrue(manager.startupTimes().isEmpty()); Formatter logFormatter = new Formatter() {
@Override public ConstructionProxy<T> create() throws ErrorsException { if (interceptors.isEmpty()) { return new DefaultConstructionProxyFactory<T>(injectionPoint).create(); } @SuppressWarnings("unchecked") Class<? extends Callback>[] callbackTypes = new Class[callbacks.length]; for (int i = 0; i < callbacks.length; i++) { if (callbacks[i] == net.sf.cglib.proxy.NoOp.INSTANCE) { callbackTypes[i] = net.sf.cglib.proxy.NoOp.class; } else { callbackTypes[i] = net.sf.cglib.proxy.MethodInterceptor.class; } } // Create the proxied class. We're careful to ensure that all enhancer state is not-specific // to this injector. Otherwise, the proxies for each injector will waste PermGen memory try { Enhancer enhancer = BytecodeGen.newEnhancer(declaringClass, visibility); enhancer.setCallbackFilter(new IndicesCallbackFilter(methods)); enhancer.setCallbackTypes(callbackTypes); return new ProxyConstructor<T>(enhancer, injectionPoint, callbacks, interceptors); } catch (Throwable e) { throw new Errors().errorEnhancingClass(declaringClass, e).toException(); } }
@Test @SuppressWarnings("deprecation") public void modifiableImmutableCollections() { ModifiableMutableImmutableCollection m = ModifiableMutableImmutableCollection.create(); m.addA("a"); m.addA("b", "c"); m.addB("d", "e"); m.putC("x", 1); m.putC("y", 2); check(m.a()).isA(ImmutableCollection.class); check(m.b()).isA(ImmutableCollection.class); check(m.c()).isA(ImmutableMultimap.class); check(m.d()).isA(ImmutableMap.class); check(m.a()).isOf("a", "b", "c"); check(m.b()).isOf("d", "e"); check(m.c().values()).isOf(1, 2); check(m.c().keySet()).isOf("x", "y"); check(m.d().isEmpty()); m.clear(); check(m.a()).isEmpty(); check(m.b()).isEmpty(); check(m.c().entries()).isEmpty(); check(m.d().entrySet()).isEmpty(); }