Package one.nio.util

Class JavaFeatures


  • public class JavaFeatures
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.invoke.MethodHandle isRecord  
      private static java.lang.invoke.MethodHandle onSpinWait  
    • Constructor Summary

      Constructors 
      Constructor Description
      JavaFeatures()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.invoke.MethodHandle getIsRecord()  
      private static java.lang.invoke.MethodHandle getOnSpinWait()  
      static boolean isRecord​(java.lang.Class<?> cls)
      Calls Class.isRecord() since Java 14 preview
      static void onSpinWait()
      Calls Thread.onSpinWait() since Java 9; does nothing otherwise
      • Methods inherited from class java.lang.Object

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

      • onSpinWait

        private static final java.lang.invoke.MethodHandle onSpinWait
      • isRecord

        private static final java.lang.invoke.MethodHandle isRecord
    • Constructor Detail

      • JavaFeatures

        public JavaFeatures()
    • Method Detail

      • getOnSpinWait

        private static java.lang.invoke.MethodHandle getOnSpinWait()
      • getIsRecord

        private static java.lang.invoke.MethodHandle getIsRecord()
      • onSpinWait

        public static void onSpinWait()
        Calls Thread.onSpinWait() since Java 9; does nothing otherwise
      • isRecord

        public static boolean isRecord​(java.lang.Class<?> cls)
        Calls Class.isRecord() since Java 14 preview
        Parameters:
        cls - a class object
        Returns:
        the result of the Class.isRecord() method invoked. It is always false, if the version of the JVM Runtime is less than 14