This class is stateful, so the same instance should be used for all class generation.
GeneratedClass
| Modifier and Type | Class and Description |
|---|---|
| private static record |
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private final Map | |
| private final ClassNameGenerator |
| Access | Constructor and Description |
|---|---|
| pack-priv | GeneratedClasses(ClassNameGenerator
the class name generator to use classNameGenerator)Create a new instance using the specified naming conventions. |
| private | GeneratedClasses(ClassNameGenerator classNameGenerator, List<GeneratedClass> classes, Map<GeneratedClasses.
|
| Modifier and Type | Method and Description |
|---|---|
| public GeneratedClass | |
| public GeneratedClass | Returns: the newly generated classthe name of the feature to associate with the
generated class featureName, ClassName the target component targetComponent, Consumer<TypeSpec.a typeConsumer used to build the typeAdd a new generated class for the specified |
| public GeneratedClass | Returns: the newly generated classthe name of the feature to associate with the
generated class featureName, Class<?> the target component targetComponent, Consumer<TypeSpec.a typeConsumer used to build the typeAdd a new generated class for the specified |
| private GeneratedClass | |
| public GeneratedClass | |
| public GeneratedClass | Returns: an existing or newly generated classthe name of the feature to associate with the
generated class featureName, ClassName the target component targetComponent, Consumer<TypeSpec.a typeConsumer used to build the typeGet or add a generated class for the specified |
| public GeneratedClass | Returns: an existing or newly generated classthe name of the feature to associate with the
generated class featureName, Class<?> the target component targetComponent, Consumer<TypeSpec.a typeConsumer used to build the typeGet or add a generated class for the specified |
| pack-priv GeneratedClasses | Returns: a new instance for the specified feature name prefixthe feature name prefix to use featureNamePrefix)Create a new |
| pack-priv void | writeTo(GeneratedFiles
where to write the generated classes generatedFiles)Write the |
| classes | back to summary |
|---|---|
| private final List<GeneratedClass> classes | |
| classesByOwner | back to summary |
|---|---|
| private final Map<GeneratedClasses. | |
| classNameGenerator | back to summary |
|---|---|
| private final ClassNameGenerator classNameGenerator | |
| GeneratedClasses | back to summary |
|---|---|
| pack-priv GeneratedClasses(ClassNameGenerator classNameGenerator) Create a new instance using the specified naming conventions.
| |
| GeneratedClasses | back to summary |
|---|---|
| private GeneratedClasses(ClassNameGenerator classNameGenerator, List<GeneratedClass> classes, Map<GeneratedClasses. | |
| addForFeature | back to summary |
|---|---|
| public GeneratedClass addForFeature(String featureName, Consumer<TypeSpec. Add a new generated class for the specified | |
| addForFeatureComponent | back to summary |
|---|---|
| public GeneratedClass addForFeatureComponent(String featureName, ClassName targetComponent, Consumer<TypeSpec. Add a new generated class for the specified | |
| addForFeatureComponent | back to summary |
|---|---|
| public GeneratedClass addForFeatureComponent(String featureName, Class<?> targetComponent, Consumer<TypeSpec. Add a new generated class for the specified | |
| createAndAddGeneratedClass | back to summary |
|---|---|
| private GeneratedClass createAndAddGeneratedClass(String featureName, ClassName targetComponent, Consumer<TypeSpec. | |
| getOrAddForFeature | back to summary |
|---|---|
| public GeneratedClass getOrAddForFeature(String featureName, Consumer<TypeSpec. Get or add a generated class for the specified | |
| getOrAddForFeatureComponent | back to summary |
|---|---|
| public GeneratedClass getOrAddForFeatureComponent(String featureName, ClassName targetComponent, Consumer<TypeSpec. Get or add a generated class for the specified | |
| getOrAddForFeatureComponent | back to summary |
|---|---|
| public GeneratedClass getOrAddForFeatureComponent(String featureName, Class<?> targetComponent, Consumer<TypeSpec. Get or add a generated class for the specified | |
| withFeatureNamePrefix | back to summary |
|---|---|
| pack-priv GeneratedClasses withFeatureNamePrefix(String featureNamePrefix) Create a new
| |
| writeTo | back to summary |
|---|---|
| pack-priv void writeTo(GeneratedFiles generatedFiles) Write the
| |
| Modifier and Type | Field and Description |
|---|---|
| private final String | featureName
Record Component accessed by featureName(). |
| private final String | featureNamePrefix
Record Component accessed by featureNamePrefix(). |
| private final ClassName |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | equals(Object
the reference object with which to compare. o)Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public String | |
| public String | |
| public final int | |
| public ClassName | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| featureName | back to summary |
|---|---|
| private final String featureName Record Component accessed by featureName(). | |
| featureNamePrefix | back to summary |
|---|---|
| private final String featureNamePrefix Record Component accessed by featureNamePrefix(). | |
| target | back to summary |
|---|---|
| private final ClassName target Record Component accessed by target(). | |
| Owner | back to summary |
|---|---|
| private Owner(String featureNamePrefix, String featureName, ClassName target) | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| featureName | back to summary |
|---|---|
| public String featureName() Record Component getter of featureName. | |
| featureNamePrefix | back to summary |
|---|---|
| public String featureNamePrefix() Record Component getter of featureNamePrefix. | |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of
| |
| target | back to summary |
|---|---|
| public ClassName target() Record Component getter of target.
| |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.
| |