Class Mutable<TYPE_OBJECT>

java.lang.Object
xyz.ronella.trivial.decorator.Mutable<TYPE_OBJECT>
Type Parameters:
TYPE_OBJECT - The type of immutable object.

public class Mutable<TYPE_OBJECT> extends Object
A convenience class that accepts an immutable object and making it possible to be replaced within itself. This means keeping the reference of this class intact while changing the immutable object it carries.
Since:
2.9.0
  • Constructor Details

    • Mutable

      public Mutable(TYPE_OBJECT object)
      Creates an instance of Mutable.
      Parameters:
      object - The immutable object to carry.
  • Method Details

    • get

      public TYPE_OBJECT get()
      Access the immutable object.
      Returns:
      The immutable object.
    • set

      public void set(TYPE_OBJECT object)
      Replace the current immutable object.
      Parameters:
      object - The new immutable object.