org.glassfish.jersey.internal.util.collection
Class Refs

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

public final class Refs
extends Object

A collection of reference factory & utility methods.

Author:
Marek Potociar (marek.potociar at oracle.com)

Method Summary
static
<T> Ref<T>
emptyRef()
          Constructs a new empty mutable Ref instance.
static
<T> Ref<T>
immutableRef(T value)
          Constructs a new immutable Ref instance referencing the given input reference.
static
<T> Ref<T>
of(T value)
          Constructs a new mutable Ref instance referencing the given input reference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

of

public static <T> Ref<T> of(T value)
Constructs a new mutable Ref instance referencing the given input reference.

Type Parameters:
T - type of the referenced instance
Parameters:
value - reference of the newly constructed reference
Returns:
a new mutable Ref instance referencing the given input reference.
See Also:
immutableRef(java.lang.Object), emptyRef()

emptyRef

public static <T> Ref<T> emptyRef()
Constructs a new empty mutable Ref instance.

Type Parameters:
T - type of the referenced instance
Returns:
a new mutable empty Ref instance
See Also:
immutableRef(java.lang.Object), of(java.lang.Object)

immutableRef

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

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 - reference of the newly constructed reference
Returns:
a new immutable Ref instance referencing the given input reference.
See Also:
emptyRef(), of(java.lang.Object)


Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.