Class Reference<T>

  • Type Parameters:
    T - type of the value

    public final class Reference<T>
    extends Object
    Wrapper class that allows to express whether the value is borrowed or owned.
    • Method Detail

      • deref

        public T deref()
      • owned

        public Optional<T> owned()
        Returns the value if it is owned.
      • isOwned

        public boolean isOwned()
      • owned

        public static <V> Reference<V> owned​(V value)
      • borrowed

        public static <V> Reference<V> borrowed​(V value)