Package jmri
Class ReferenceNotNull<E>
- java.lang.Object
-
- jmri.ReferenceNotNull<E>
-
- Type Parameters:
E
- the type of the reference
public class ReferenceNotNull<E> extends java.lang.Object
A reference to an object where the object must not be null. It's a faster replacement for AtomicReference when thread safety is not needed.
-
-
Constructor Summary
Constructors Constructor Description ReferenceNotNull()
Create an instance of Reference.ReferenceNotNull(E ref)
Create an instance of Reference.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description E
get()
Return the reference.void
set(E ref)
Set the reference.
-
-
-
Constructor Detail
-
ReferenceNotNull
public ReferenceNotNull()
Create an instance of Reference.
-
ReferenceNotNull
public ReferenceNotNull(@Nonnull E ref)
Create an instance of Reference.- Parameters:
ref
- the reference
-
-