package bjc.functypes; import bjc.typeclasses.Container; /** * Represents a constant container * * @author bjcul * * @param The type of the value * @param The ignored argument type */ public class Const implements Container>{ private V payload; private Const(V payload) { this.payload = payload; } /** * Create a constant container. * * @param The value contained * @param The ignored argument type * * @param val The type of the value * * @return A constant container giving the contained value */ public static Const of(V val) { return new Const<>(val); } V get() { return payload; } }