Class BootstrapFamilies


  • public final class BootstrapFamilies
    extends Object
    Owner/name predicates for the JDK bootstrap-method families reachable from invokedynamic and constant-dynamic.
    • Field Detail

      • LAMBDA_METAFACTORY

        public static final String LAMBDA_METAFACTORY
        Internal name of LambdaMetafactory, the lambda/method-reference bootstrap owner.
        See Also:
        Constant Field Values
      • STRING_CONCAT_FACTORY

        public static final String STRING_CONCAT_FACTORY
        Internal name of StringConcatFactory, the string-concatenation bootstrap owner.
        See Also:
        Constant Field Values
      • OBJECT_METHODS

        public static final String OBJECT_METHODS
        Internal name of ObjectMethods, the record-component bootstrap owner (Java 16+).
        See Also:
        Constant Field Values
      • SWITCH_BOOTSTRAPS

        public static final String SWITCH_BOOTSTRAPS
        Internal name of SwitchBootstraps, the pattern-switch bootstrap owner (Java 21+).
        See Also:
        Constant Field Values
    • Method Detail

      • isStringConcat

        public static boolean isStringConcat​(String owner)
        Tests whether an owner is StringConcatFactory.
        Parameters:
        owner - internal name of the bootstrap owner
        Returns:
        true if the owner is the string-concatenation factory
      • isLambda

        public static boolean isLambda​(String owner,
                                       String name)
        Tests whether an owner/name pair is the LambdaMetafactory metafactory or altMetafactory bootstrap.
        Parameters:
        owner - internal name of the bootstrap owner
        name - bootstrap method name
        Returns:
        true if the pair names a lambda metafactory bootstrap
      • isRecord

        public static boolean isRecord​(String owner,
                                       String name)
        Tests whether an owner/name pair is the ObjectMethods.bootstrap record bootstrap.
        Parameters:
        owner - internal name of the bootstrap owner
        name - bootstrap method name
        Returns:
        true if the pair names the record bootstrap
      • isSwitch

        public static boolean isSwitch​(String owner)
        Tests whether an owner is SwitchBootstraps.
        Parameters:
        owner - internal name of the bootstrap owner
        Returns:
        true if the owner is the pattern-switch bootstrap holder