java.lang.Object
org.glassfish.jersey.internal.util.collection.Refs

public final class Refs extends Object
A collection of reference factory invalid input: '&' utility methods.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static final class 
    Default (mutable) Ref implementation.
    private static final class 
    Immutable Ref implementation.
    private static final class 
    Thread-safe Ref implementation.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> Ref<T>
    Construct a new empty mutable Ref instance.
    static <T> Ref<T>
    immutableRef(T value)
    Construct a new immutable Ref instance referencing the given input value.
    static <T> Ref<T>
    of(T value)
    Construct a new mutable Ref instance referencing the given input value.
    static <T> Ref<T>
    Construct a new empty mutable thread-safe Ref instance.
    static <T> Ref<T>
    threadSafe(T value)
    Construct a new mutable thread-safe Ref instance referencing the given input value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Refs

      private Refs()
  • Method Details

    • of

      public static <T> Ref<T> of(T value)
      Construct a new mutable Ref instance referencing the given input value.
      Type Parameters:
      T - type of the referenced instance.
      Parameters:
      value - value of the newly constructed reference.
      Returns:
      a new mutable Ref instance referencing the given input value.
    • emptyRef

      public static <T> Ref<T> emptyRef()
      Construct a new empty mutable Ref instance.
      Type Parameters:
      T - type of the referenced instance.
      Returns:
      a new mutable empty Ref instance.
    • threadSafe

      public static <T> Ref<T> threadSafe()
      Construct a new empty mutable thread-safe Ref instance.
      Type Parameters:
      T - type of the referenced instance.
      Returns:
      a new mutable empty thread-safe Ref instance.
      Since:
      2.8
    • threadSafe

      public static <T> Ref<T> threadSafe(T value)
      Construct a new mutable thread-safe Ref instance referencing the given input value.
      Type Parameters:
      T - type of the referenced instance.
      Parameters:
      value - value of the newly constructed reference.
      Returns:
      a new mutable thread-safe Ref instance referencing the given input value.
      Since:
      2.8
    • immutableRef

      public static <T> Ref<T> immutableRef(T value)
      Construct a new immutable Ref instance referencing the given input value.

      Invoking a Settable.set(java.lang.Object) on the returned instance will result in a IllegalStateException being thrown.

      Type Parameters:
      T - type of the referenced instance.
      Parameters:
      value - value of the newly constructed reference.
      Returns:
      a new immutable Ref instance referencing the given input value.