MCPcopy Create free account
hub / github.com/grpc/grpc-java / FixedObjectPool

Class FixedObjectPool

core/src/main/java/io/grpc/internal/FixedObjectPool.java:24–40  ·  view source on GitHub ↗

An object pool that always returns the same instance and does nothing when returning the object.

Source from the content-addressed store, hash-verified

22 * An object pool that always returns the same instance and does nothing when returning the object.
23 */
24public final class FixedObjectPool<T> implements ObjectPool<T> {
25 private final T object;
26
27 public FixedObjectPool(T object) {
28 this.object = Preconditions.checkNotNull(object, "object");
29 }
30
31 @Override
32 public T getObject() {
33 return object;
34 }
35
36 @Override
37 public T returnObject(Object returned) {
38 return null;
39 }
40}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected