Enum SpringPageableScanUtils.AnnotationSyntax

  • All Implemented Interfaces:
    Serializable, Comparable<SpringPageableScanUtils.AnnotationSyntax>
    Enclosing class:
    SpringPageableScanUtils

    public static enum SpringPageableScanUtils.AnnotationSyntax
    extends Enum<SpringPageableScanUtils.AnnotationSyntax>
    Target language annotation syntax for pageable annotations.

    Java and Kotlin differ in how array-valued annotation attributes are written:

    • Java uses curly braces: @ValidSort(allowedValues = {"a,asc"})
    • Kotlin uses square brackets: @ValidSort(allowedValues = ["a,asc"])

    Additionally, repeated @SortDefault items inside @SortDefault.SortDefaults differ: Java prefixes each with @ and wraps the list in {}, whereas Kotlin omits the @ and passes the items without extra wrapping.

    • Method Detail

      • values

        public static SpringPageableScanUtils.AnnotationSyntax[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (SpringPageableScanUtils.AnnotationSyntax c : SpringPageableScanUtils.AnnotationSyntax.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SpringPageableScanUtils.AnnotationSyntax valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • arrayLiteral

        public String arrayLiteral​(String content)
        Formats content as an array literal for this language: {content} for Java, [content] for Kotlin.
      • sortDefaultItem

        public String sortDefaultItem​(String innerContent)
        Formats a single @SortDefault annotation item. Java: @SortDefault(innerContent), Kotlin: SortDefault(innerContent).
      • sortDefaultsArgs

        public String sortDefaultsArgs​(List<String> items)
        Formats the argument list inside @SortDefault.SortDefaults(...). Java wraps with {}: @SortDefault.SortDefaults({item1, item2}). Kotlin passes items directly: @SortDefault.SortDefaults(item1, item2).