org.lambda.utils.Mutable Maven / Gradle / Ivy
package org.lambda.utils;
import org.lambda.functions.Function1;
public class Mutable
{
private T object;
public Mutable(T object)
{
this.object = object;
}
public T get()
{
return object;
}
public T set(T object)
{
this.object = object;
return object;
}
public T update(Function1 updater)
{
this.object = updater.call(this.object);
return this.object;
}
}