Package dev.brachtendorf.mutable
Class MutableObject<T>
- java.lang.Object
-
- dev.brachtendorf.mutable.MutableObject<T>
-
- All Implemented Interfaces:
Mutable<T>
public class MutableObject<T> extends Object implements Mutable<T>
* Mutable class wrapper for objects. Mutable classes are useful in lambda expressions or anonymous classes which want to alter the content of a variable but are limited to final or effective final variables. * Be aware that the hashcode changes if the value is updated resulting in the object not being retrievable in hash collections.- Since:
- 1.5.10 com.github.kilianB
- Author:
- Kilian
-
-
Constructor Summary
Constructors Constructor Description MutableObject()MutableObject(T initialValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)TgetValue()Get an object encapsulating the current valueinthashCode()voidsetValue(T newValue)Set the internal field to the new value
-
-
-
Constructor Detail
-
MutableObject
public MutableObject()
-
MutableObject
public MutableObject(T initialValue)
-
-