mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 18:55:18 +00:00
34 lines
333 B
Java
34 lines
333 B
Java
package com.volmit.iris.util;
|
|
|
|
import java.util.function.Function;
|
|
|
|
public class Contained<T>
|
|
{
|
|
private T t;
|
|
|
|
public Contained(T t)
|
|
{
|
|
set(t);
|
|
}
|
|
|
|
public Contained()
|
|
{
|
|
this(null);
|
|
}
|
|
|
|
public void mod(Function<T, T> x)
|
|
{
|
|
set(x.apply(t));
|
|
}
|
|
|
|
public T get()
|
|
{
|
|
return t;
|
|
}
|
|
|
|
public void set(T t)
|
|
{
|
|
this.t = t;
|
|
}
|
|
}
|