Module openj9.dtfj

Class J9ConstantHelper


  • public final class J9ConstantHelper
    extends Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean getBoolean​(Class<?> clazz, String name, boolean defaultValue)
      Using reflection, read the value of a public static final boolean field from the given class or, if the field is not present, return the default value provided.
      static int getInt​(Class<?> clazz, String name, int defaultValue)
      Using reflection, read the value of a public static final int field from the given class or, if the field is not present, return the default value provided.
      static long getLong​(Class<?> clazz, String name, long defaultValue)
      Using reflection, read the value of a public static final long field from the given class or, if the field is not present, return the default value provided.
    • Constructor Detail

      • J9ConstantHelper

        public J9ConstantHelper()
    • Method Detail

      • getLong

        public static long getLong​(Class<?> clazz,
                                   String name,
                                   long defaultValue)
        Using reflection, read the value of a public static final long field from the given class or, if the field is not present, return the default value provided.
        Parameters:
        clazz - the class which owns the field of interest
        name - the name of the field
        defaultValue - the value to be returned if the field is not present
        Returns:
        the value of the field, or the default value
      • getBoolean

        public static boolean getBoolean​(Class<?> clazz,
                                         String name,
                                         boolean defaultValue)
        Using reflection, read the value of a public static final boolean field from the given class or, if the field is not present, return the default value provided.
        Parameters:
        clazz - the class which owns the field of interest
        name - the name of the field
        defaultValue - the value to be returned if the field is not present
        Returns:
        the value of the boolean field, or the default value
      • getInt

        public static int getInt​(Class<?> clazz,
                                 String name,
                                 int defaultValue)
        Using reflection, read the value of a public static final int field from the given class or, if the field is not present, return the default value provided.
        Parameters:
        clazz - the class which owns the field of interest
        name - the name of the field
        defaultValue - the value to be returned if the field is not present
        Returns:
        the value of the field, or the default value