0
# Experimental Features
1
2
Advanced and experimental features including utility classes, field name constants, and enhanced builder patterns.
3
4
## Capabilities
5
6
### @SuperBuilder
7
8
```java { .api }
9
@Target(ElementType.TYPE)
10
@Retention(RetentionPolicy.SOURCE)
11
public @interface SuperBuilder {
12
String builderMethodName() default "builder";
13
String buildMethodName() default "build";
14
boolean toBuilder() default false;
15
String setterPrefix() default "";
16
}
17
```
18
19
### @UtilityClass
20
21
```java { .api }
22
@Target(ElementType.TYPE)
23
@Retention(RetentionPolicy.SOURCE)
24
public @interface UtilityClass {
25
}
26
```
27
28
### @FieldNameConstants
29
30
```java { .api }
31
@Target(ElementType.TYPE)
32
@Retention(RetentionPolicy.SOURCE)
33
public @interface FieldNameConstants {
34
AccessLevel level() default AccessLevel.PUBLIC;
35
boolean asEnum() default false;
36
String innerTypeName() default "Fields";
37
boolean onlyExplicitlyIncluded() default false;
38
}
39
```
40
41
### @Delegate
42
43
```java { .api }
44
@Target({ElementType.FIELD, ElementType.METHOD})
45
@Retention(RetentionPolicy.SOURCE)
46
public @interface Delegate {
47
Class<?>[] types() default {};
48
Class<?>[] excludes() default {};
49
}
50
```
51
52
**Usage Examples:**
53
54
```java
55
import lombok.experimental.*;
56
57
@UtilityClass
58
public class MathUtils {
59
public static int add(int a, int b) {
60
return a + b;
61
}
62
}
63
64
@FieldNameConstants
65
public class User {
66
private String name;
67
private int age;
68
69
// Generated: public static final String NAME = "name";
70
// Generated: public static final String AGE = "age";
71
}
72
```