Class Swap

  • All Implemented Interfaces:
    java.util.function.LongFunction<java.lang.Object>

    public class Swap
    extends java.lang.Object
    implements java.util.function.LongFunction<java.lang.Object>
    Load a named value from the per-thread state map. The previous input value will be stored in the named value, and the previously stored value will be returned. A default value to return may be provided in case there was no previously stored value under the given name.
    • Constructor Summary

      Constructors 
      Constructor Description
      Swap​(java.lang.String name)  
      Swap​(java.lang.String name, java.lang.Object defaultValue)  
      Swap​(java.util.function.LongFunction<java.lang.Object> nameFunc)  
      Swap​(java.util.function.LongFunction<java.lang.Object> nameFunc, java.lang.Object defaultValue)  
    • Method Summary

      Modifier and Type Method Description
      java.lang.Object apply​(long value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Swap

        public Swap​(java.lang.String name)
      • Swap

        public Swap​(java.lang.String name,
                    java.lang.Object defaultValue)
      • Swap

        public Swap​(java.util.function.LongFunction<java.lang.Object> nameFunc)
      • Swap

        public Swap​(java.util.function.LongFunction<java.lang.Object> nameFunc,
                    java.lang.Object defaultValue)
    • Method Detail

      • apply

        public java.lang.Object apply​(long value)
        Specified by:
        apply in interface java.util.function.LongFunction<java.lang.Object>