Class CallableRef<T>

java.lang.Object
alexiil.mc.lib.attributes.misc.CallableRef<T>
All Implemented Interfaces:
Reference<T>

public final class CallableRef<T>
extends java.lang.Object
implements Reference<T>
A Reference that delegates to a Supplier for get(), Consumer for set(Object), and a Predicate for isValid(Object).
  • Constructor Summary

    Constructors 
    Constructor Description
    CallableRef​(java.util.function.Supplier<T> getter, java.util.function.Consumer<T> setter, java.util.function.Predicate<T> canSet)  
  • Method Summary

    Modifier and Type Method Description
    T get()  
    boolean isValid​(T value)  
    boolean set​(T value)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface alexiil.mc.lib.attributes.misc.Reference

    asDestroyable, set
  • Constructor Details

    • CallableRef

      public CallableRef​(java.util.function.Supplier<T> getter, java.util.function.Consumer<T> setter, java.util.function.Predicate<T> canSet)
  • Method Details