public class CopyOnWriteRef<T>
extends Object
-
-
Constructor Summary
Constructors
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
value
@Nullable
private T value
-
referenceCount
private int referenceCount
-
copyFunction
@NotNull
private final @NotNull Function<T,T> copyFunction
-
Constructor Details
-
CopyOnWriteRef
public CopyOnWriteRef(@Nullable
T value,
@NotNull
@NotNull Function<T,T> copyFunction)
-
Method Details
-
getPeek
@Nullable
public T getPeek()
-
getImmutable
@Nullable
public T getImmutable()
-
getMutable
@Nullable
public T getMutable()
-
setValue
public void setValue(@Nullable
T value)
-
isMutable
public boolean isMutable()