Object KotlinAnnotationSpecBuilder.member

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final CodeBlock string(String name, String value) Build a CodeBlock assigning a String value to an annotation member.
      final CodeBlock strings(String name, String values) Build a CodeBlock assigning multiple String values to an annotation member array.
      final CodeBlock number(String name, Number value) Build a CodeBlock assigning a numeric value to an annotation member.
      final CodeBlock numbers(String name, Number values) Build a CodeBlock assigning multiple numeric values to an annotation member array.
      final CodeBlock kclass(String name, KClass<?> value) Build a CodeBlock assigning a KClass value to an annotation member.
      final CodeBlock kclass(String name, ClassName value) Build a CodeBlock assigning a ClassName value to an annotation member.
      final CodeBlock kclasses(String name, KClass<?> values) Build a CodeBlock assigning multiple KClass values to an annotation member array.
      final CodeBlock kclasses(String name, ClassName values) Build a CodeBlock assigning multiple ClassName values to an annotation member array.
      final CodeBlock enum(String name, Enum<?> value) Build a CodeBlock assigning an Enum entry to an annotation member.
      final CodeBlock enums(String name, Enum<?> values) Build a CodeBlock assigning multiple Enum entries to an annotation member array.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • string

         final CodeBlock string(String name, String value)

        Build a CodeBlock assigning a String value to an annotation member. Example: name = "value"

        Parameters:
        name - the annotation member name
        value - the String value
        Returns:

        the CodeBlock representing the annotation member assignment

      • strings

         final CodeBlock strings(String name, String values)

        Build a CodeBlock assigning multiple String values to an annotation member array. Example: names = "a", "b"

        Parameters:
        name - the annotation member name
        values - the String values
        Returns:

        the CodeBlock representing the annotation member array assignment

      • number

         final CodeBlock number(String name, Number value)

        Build a CodeBlock assigning a numeric value to an annotation member. Example: priority = 5

        Parameters:
        name - the annotation member name
        value - the Number value
        Returns:

        the CodeBlock representing the annotation member assignment

      • numbers

         final CodeBlock numbers(String name, Number values)

        Build a CodeBlock assigning multiple numeric values to an annotation member array. Example: codes = 1, 2, 3

        Parameters:
        name - the annotation member name
        values - the Number values
        Returns:

        the CodeBlock representing the annotation member array assignment

      • kclass

         final CodeBlock kclass(String name, KClass<?> value)

        Build a CodeBlock assigning a KClass value to an annotation member. Example: type = MyType::class

        Parameters:
        name - the annotation member name
        value - the KClass value
        Returns:

        the CodeBlock representing the annotation member assignment

      • kclass

         final CodeBlock kclass(String name, ClassName value)

        Build a CodeBlock assigning a ClassName value to an annotation member. Example: type = MyType::class

        Parameters:
        name - the annotation member name
        value - the ClassName value
        Returns:

        the CodeBlock representing the annotation member assignment

      • kclasses

         final CodeBlock kclasses(String name, KClass<?> values)

        Build a CodeBlock assigning multiple KClass values to an annotation member array. Example: types = A::class, B::class

        Parameters:
        name - the annotation member name
        values - the KClass values
        Returns:

        the CodeBlock representing the annotation member array assignment

      • kclasses

         final CodeBlock kclasses(String name, ClassName values)

        Build a CodeBlock assigning multiple ClassName values to an annotation member array. Example: types = A::class, B::class

        Parameters:
        name - the annotation member name
        values - the ClassName values
        Returns:

        the CodeBlock representing the annotation member array assignment

      • enum

         final CodeBlock enum(String name, Enum<?> value)

        Build a CodeBlock assigning an Enum entry to an annotation member. Example: mode = Mode.FAST

        Parameters:
        name - the annotation member name
        value - the Enum constant
        Returns:

        the CodeBlock representing the annotation member assignment

      • enums

         final CodeBlock enums(String name, Enum<?> values)

        Build a CodeBlock assigning multiple Enum entries to an annotation member array. Example: modes = Mode.FAST, Mode.SAFE

        Parameters:
        name - the annotation member name
        values - the Enum constants
        Returns:

        the CodeBlock representing the annotation member array assignment