Class Cell<T>

java.lang.Object
io.apicurio.registry.utils.Cell<T>

public class Cell<T> extends Object
One-item non-thread-safe container that can be used to pass a value into or out of a lambda function.

If you need a thread-safe alternative, use an AtomicReference.

  • Method Details

    • cell

      public static <T> Cell<T> cell(T value)
    • cellOrDefault

      public static <T> Cell<T> cellOrDefault(T value, T defaultValue)
    • cellWithLoader

      public static <T> Cell<T> cellWithLoader(Supplier<T> loader)
    • cell

      public static <T> Cell<T> cell()
    • get

      public T get()
    • getOptional

      public Optional<T> getOptional()
    • set

      public void set(T value)
    • isSet

      public boolean isSet()