Package org.agrona.collections
Class MutableReference<T>
- java.lang.Object
-
- org.agrona.collections.MutableReference<T>
-
- Type Parameters:
T
- type of the reference.
public class MutableReference<T> extends java.lang.Object
Mutable reference that is useful for capturing an object reference when using lambdas.
-
-
Constructor Summary
Constructors Constructor Description MutableReference()
Default constructor.MutableReference(T ref)
Set the reference at construction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
T
get()
Get the current value of the reference.int
hashCode()
void
set(T ref)
Set the current value of the reference.java.lang.String
toString()
-
-
-
Field Detail
-
ref
public T ref
For convenient access.
-
-
Constructor Detail
-
MutableReference
public MutableReference()
Default constructor.
-
MutableReference
public MutableReference(T ref)
Set the reference at construction.- Parameters:
ref
- to be set.
-
-
Method Detail
-
get
public T get()
Get the current value of the reference.- Returns:
- the current value of the reference.
-
set
public void set(T ref)
Set the current value of the reference.- Parameters:
ref
- to be set.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-