CallCredentialsApplyingTransportFactory( ClientTransportFactory delegate, Executor appExecutor) { this.delegate = checkNotNull(delegate, "delegate"); this.appExecutor = checkNotNull(appExecutor, "appExecutor"); }
protected TransportState( int maxMessageSize, StatsTraceContext statsTraceCtx, TransportTracer transportTracer) { super( maxMessageSize, statsTraceCtx, Preconditions.checkNotNull(transportTracer, "transportTracer")); this.statsTraceCtx = Preconditions.checkNotNull(statsTraceCtx, "statsTraceCtx"); }
@Override public byte[] toByteArray(SpanContext spanContext) { checkNotNull(spanContext, "spanContext"); return new byte[0]; }
/** * Generate the fully qualified method name. * * @param fullServiceName the fully qualified service name that is prefixed with the package name * @param methodName the short method name * @since 1.0.0 */ public static String generateFullMethodName(String fullServiceName, String methodName) { return checkNotNull(fullServiceName, "fullServiceName") + "/" + checkNotNull(methodName, "methodName"); }
@Override public byte[] toByteArray(TagContext tags) { checkNotNull(tags, "tags"); return EMPTY_BYTE_ARRAY; }
@Override public boolean matchesAllOf(CharSequence sequence) { checkNotNull(sequence); return true; }
@Override public String removeFrom(CharSequence sequence) { checkNotNull(sequence); return ""; }
static <T, K, V> Collector<T, ?, ImmutableMap<K, V>> toImmutableMap( Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction) { checkNotNull(keyFunction); checkNotNull(valueFunction); return Collector.of( ImmutableMap.Builder<K, V>::new, (builder, input) -> builder.put(keyFunction.apply(input), valueFunction.apply(input)), ImmutableMap.Builder::combine, ImmutableMap.Builder::build); }
/** * Constructs a new Service Descriptor. Users are encouraged to use {@link #newBuilder} * instead. * * @param name The name of the service * @param methods The methods that are part of the service * @since 1.0.0 */ public ServiceDescriptor(String name, Collection<MethodDescriptor<?, ?>> methods) { this(newBuilder(name).addAllMethods(checkNotNull(methods, "methods"))); }
/** * Add a method to be supported by the service. * * @param method the {@link MethodDescriptor} of this method. * @param handler handler for incoming calls */ public <ReqT, RespT> Builder addMethod( MethodDescriptor<ReqT, RespT> method, ServerCallHandler<ReqT, RespT> handler) { return addMethod(ServerMethodDefinition.create( checkNotNull(method, "method must not be null"), checkNotNull(handler, "handler must not be null"))); }
@Override public void invalidate(Object key) { checkNotNull(key); localCache.remove(key); }
@Override @Deprecated public void setState(TaggingState state) { Preconditions.checkNotNull(state, "state"); Preconditions.checkState(!isRead, "State was already read, cannot set state."); } }
@Override public Scope withTagContext(TagContext tags) { checkNotNull(tags, "tags"); return NoopScope.getInstance(); } }
private void setDecompressorRegistry(DecompressorRegistry decompressorRegistry) { Preconditions.checkState(this.listener == null, "Already called start"); this.decompressorRegistry = checkNotNull(decompressorRegistry, "decompressorRegistry"); }
@SuppressWarnings("deprecation") // intentional; deprecation is for callers primarily @Override public boolean apply(Character character) { return predicate.apply(checkNotNull(character)); }
public static ServerServiceDefinition intercept(BindableService bindableService, ServerInterceptor... interceptors) { Preconditions.checkNotNull(bindableService, "bindableService"); return intercept(bindableService.bindService(), Arrays.asList(interceptors)); }
@Override @CanIgnoreReturnValue public boolean remove(Object object) { return delegate().remove(checkNotNull(object)); }
/** @since 12.0 */ @GwtIncompatible // NavigableSet @Override public ContiguousSet<C> subSet( C fromElement, boolean fromInclusive, C toElement, boolean toInclusive) { checkNotNull(fromElement); checkNotNull(toElement); checkArgument(comparator().compare(fromElement, toElement) <= 0); return subSetImpl(fromElement, fromInclusive, toElement, toInclusive); }
public static ServerServiceDefinition intercept(BindableService bindableService, List<? extends ServerInterceptor> interceptors) { Preconditions.checkNotNull(bindableService, "bindableService"); return intercept(bindableService.bindService(), interceptors); }
@Override public final void writeMessage(InputStream message) { checkNotNull(message, "message"); if (!framer().isClosed()) { framer().writePayload(message); } }