Object KotlinAnnotationSpecBuilder.member
-
- All Implemented Interfaces:
public class KotlinAnnotationSpecBuilder.member
-
-
Field Summary
Fields Modifier and Type Field Description public final static KotlinAnnotationSpecBuilder.memberINSTANCE
-
Method Summary
Modifier and Type Method Description final CodeBlockstring(String name, String value)Build a CodeBlock assigning a String value to an annotation member. final CodeBlockstrings(String name, String values)Build a CodeBlock assigning multiple String values to an annotation member array. final CodeBlocknumber(String name, Number value)Build a CodeBlock assigning a numeric value to an annotation member. final CodeBlocknumbers(String name, Number values)Build a CodeBlock assigning multiple numeric values to an annotation member array. final CodeBlockkclass(String name, KClass<?> value)Build a CodeBlock assigning a KClass value to an annotation member. final CodeBlockkclass(String name, ClassName value)Build a CodeBlock assigning a ClassName value to an annotation member. final CodeBlockkclasses(String name, KClass<?> values)Build a CodeBlock assigning multiple KClass values to an annotation member array. final CodeBlockkclasses(String name, ClassName values)Build a CodeBlock assigning multiple ClassName values to an annotation member array. final CodeBlockenum(String name, Enum<?> value)Build a CodeBlock assigning an Enum entry to an annotation member. final CodeBlockenums(String name, Enum<?> values)Build a CodeBlock assigning multiple Enum entries to an annotation member array. -
-
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 namevalue- 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 namevalues- 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 namevalue- 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 namevalues- 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 namevalue- 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 namevalue- 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 namevalues- 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 namevalues- 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 namevalue- 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 namevalues- the Enum constants- Returns:
the CodeBlock representing the annotation member array assignment
-
-
-
-