package com.google.ipc.invalidation.util;
-import com.google.common.base.Supplier;
-
/**
* Container for a single arbitrary value. Useful when a nested callback needs
* to modify a primitive type, which is ordinarily not possible as variables
* @param <T> Type of the value being boxed.
*
*/
-public class Box<T> implements Supplier<T> {
+public class Box<T> {
/** Contents of the box. */
private T value;
this.value = value;
}
- /**
- * Returns a supplier for the given value. Note that such a getter's internal value cannot be
- * changed (by definition).
- */
- public static <T> Supplier<T> createSupplier(final T value) {
- return Box.of(value);
- }
-
/** Constructs a Box with {@code null} as the value. */
public Box() {
this.value = null;
this.value = objectValue;
}
- @Override
public T get() {
return value;
}