Package alexiil.mc.lib.attributes.misc
Class UnmodifiableRef<T>
java.lang.Object
alexiil.mc.lib.attributes.misc.UnmodifiableRef<T>
- All Implemented Interfaces:
Reference<T>
A
Reference
that may be obtained through get()
, but never allows the value to be changed in
set(Object)
.-
Field Details
-
obj
-
-
Constructor Details
-
UnmodifiableRef
-
-
Method Details
-
get
- Specified by:
get
in interfaceReference<T>
- Returns:
- The object referenced. Note that you should generally not modify the returned value directly - instead
copy it before passing it to
Reference.set(Object)
orReference.isValid(Object)
to see if your modifications are permitted.
-
set
-
isValid
- Specified by:
isValid
in interfaceReference<T>
- Returns:
- True if
Reference.set(Object)
was called with the same value.
-