Skip to content

Commit

Permalink
Reformat & Rephrase Generated JavaDocs (#274)
Browse files Browse the repository at this point in the history
Enhances all JavaDocs in generated `record` and `enum` classes by correcting grammatical issues and adhering more to the Google-Java-Format. This affects the placeholder JavaDocs in generated classes, but does not change any behavior or functionality.
  • Loading branch information
Chrimle authored Dec 24, 2024
1 parent 7d37ddc commit 3f0abd7
Show file tree
Hide file tree
Showing 109 changed files with 468 additions and 410 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The mustache templates are best acquired by importing the project as a dependenc
<dependency>
<groupId>io.github.chrimle</groupId>
<artifactId>openapi-to-java-records-mustache-templates</artifactId>
<version>2.4.0</version>
<version>2.5.0</version>
</dependency>
```
It is **strongly recommended** to import the project as a dependency. It has officially been published to:
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The mustache templates are best acquired by importing the project as a dependenc
<dependency>
<groupId>io.github.chrimle</groupId>
<artifactId>openapi-to-java-records-mustache-templates</artifactId>
<version>2.4.0</version>
<version>2.5.0</version>
</dependency>
```
It is **strongly recommended** to import the project as a dependency. It has officially been published to:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>io.github.chrimle</groupId>
<artifactId>openapi-to-java-records-mustache-templates</artifactId>
<version>2.4.0</version>
<version>2.5.0</version>

<!-- Project Information -->
<name>OpenAPI to Java records :: Mustache Templates</name>
Expand Down
12 changes: 7 additions & 5 deletions src/main/resources/templates/generateBuilders.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

}}{{#generateBuilders}}

/** Builder class for {@link {{classname}} } */
/** Builder class for {@link {{classname}} }. */
public static class Builder {
{{#vars}}
Expand All @@ -35,8 +35,9 @@
* Sets the value of {@link {{classname}}#{{name}} }.
*
* <p><b>NOTE:</b> Pass-by-reference is used!
* @param {{name}} {{description}}{{^description}}sets the value of {{name}}{{/description}}
* @return this {@link Builder}-instance for method-chaining
*
* @param {{name}} {{description}}{{^description}}sets the value of {{name}}{{/description}}.
* @return this {@link Builder}-instance for method-chaining.
*/
public Builder {{name}}(final {{{datatypeWithEnum}}} {{name}}) {
this.{{name}} = {{name}};
Expand All @@ -49,7 +50,8 @@
* builder methods.
*
* <p><b>NOTE:</b> Pass-by-reference is used!
* @return a new {@link {{classname}} }-instance
*
* @return a new {@link {{classname}} }-instance.
*/
public {{classname}} build() {
return new {{classname}}(
Expand All @@ -59,7 +61,7 @@
}
}

/** Creates a {@link Builder}-instance. */
/** Creates a new {@link Builder}-instance. */
public static {{classname}}.Builder builder() {
return new {{classname}}.Builder();
}{{!
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/templates/modelEnum.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
/**
* Gets the {@code value} of this enum.
*
* @return value of this enum
* @return the value of this enum.
*/
public {{{dataType}}} getValue() {
return value;
Expand All @@ -60,9 +60,9 @@
* <p><b>NOTE:</b> if multiple enum constants have a matching value, the first enum constant is
* returned, by the order they are declared.
*
* @param value of the Enum
* @return a {@link {{classname}} } with the matching value
* @throws IllegalArgumentException if no enum has a value matching the given value
* @param value of the enum.
* @return a {@link {{classname}} } with the matching value.
* @throws IllegalArgumentException if no enum has a value matching the given value.
*/
public static {{classname}} fromValue(final {{{dataType}}} value) {
for (final {{classname}} constant : {{classname}}.values()) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/templates/pojo.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
/**
* Gets the {@code value} of this enum.
*
* @return value of this enum
* @return the value of this enum.
*/
public {{{dataType}}} getValue() {
return value;
Expand All @@ -88,9 +88,9 @@
* <p><b>NOTE:</b> if multiple enum constants have a matching value, the first enum constant is
* returned, by the order they are declared.
*
* @param value of the Enum
* @return a {@link {{datatypeWithEnum}} } with the matching value
* @throws IllegalArgumentException if no enum has a value matching the given value
* @param value of the enum.
* @return a {@link {{datatypeWithEnum}} } with the matching value.
* @throws IllegalArgumentException if no enum has a value matching the given value.
*/
public static {{datatypeWithEnum}} fromValue(final {{{dataType}}} value) {
for (final {{datatypeWithEnum}} constant : {{datatypeWithEnum}}.values()) {
Expand Down
14 changes: 8 additions & 6 deletions target/classes/templates/generateBuilders.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
}}{{!
Source: openapi-to-java-records-mustache-templates
Version: 2.4.0
Version: 2.5.0
This template is a custom template, and is used by `pojo.mustache`.
Enabled via configOptions.generateBuilders=true
}}{{#generateBuilders}}

/** Builder class for {@link {{classname}} } */
/** Builder class for {@link {{classname}} }. */
public static class Builder {
{{#vars}}
Expand All @@ -35,8 +35,9 @@
* Sets the value of {@link {{classname}}#{{name}} }.
*
* <p><b>NOTE:</b> Pass-by-reference is used!
* @param {{name}} {{description}}{{^description}}sets the value of {{name}}{{/description}}
* @return this {@link Builder}-instance for method-chaining
*
* @param {{name}} {{description}}{{^description}}sets the value of {{name}}{{/description}}.
* @return this {@link Builder}-instance for method-chaining.
*/
public Builder {{name}}(final {{{datatypeWithEnum}}} {{name}}) {
this.{{name}} = {{name}};
Expand All @@ -49,7 +50,8 @@
* builder methods.
*
* <p><b>NOTE:</b> Pass-by-reference is used!
* @return a new {@link {{classname}} }-instance
*
* @return a new {@link {{classname}} }-instance.
*/
public {{classname}} build() {
return new {{classname}}(
Expand All @@ -59,7 +61,7 @@
}
}

/** Creates a {@link Builder}-instance. */
/** Creates a new {@link Builder}-instance. */
public static {{classname}}.Builder builder() {
return new {{classname}}.Builder();
}{{!
Expand Down
2 changes: 1 addition & 1 deletion target/classes/templates/javadoc.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}}{{!
Source: openapi-to-java-records-mustache-templates
Version: 2.4.0
Version: 2.5.0
This template is a custom template, and is used by `pojo.mustache` and `modelEnum.mustache`.
Expand Down
4 changes: 2 additions & 2 deletions target/classes/templates/licenseInfo.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}}{{!
Source: openapi-to-java-records-mustache-templates
Version: 2.4.0
Version: 2.5.0
This template is overriding an official 'openapi-generator-maven-plugin' template.
Expand All @@ -33,6 +33,6 @@
* openapi-to-java-records-mustache-templates. For further information,
* questions, requesting features or reporting issues, please visit:
* https://github.com/Chrimle/openapi-to-java-records-mustache-templates.
* Generated with Version: 2.4.0
* Generated with Version: 2.5.0
*
*/
10 changes: 5 additions & 5 deletions target/classes/templates/modelEnum.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}}{{!
Source: openapi-to-java-records-mustache-templates
Version: 2.4.0
Version: 2.5.0
This template is overriding an official 'openapi-generator-maven-plugin' template.
Expand Down Expand Up @@ -47,7 +47,7 @@
/**
* Gets the {@code value} of this enum.
*
* @return value of this enum
* @return the value of this enum.
*/
public {{{dataType}}} getValue() {
return value;
Expand All @@ -60,9 +60,9 @@
* <p><b>NOTE:</b> if multiple enum constants have a matching value, the first enum constant is
* returned, by the order they are declared.
*
* @param value of the Enum
* @return a {@link {{classname}} } with the matching value
* @throws IllegalArgumentException if no enum has a value matching the given value
* @param value of the enum.
* @return a {@link {{classname}} } with the matching value.
* @throws IllegalArgumentException if no enum has a value matching the given value.
*/
public static {{classname}} fromValue(final {{{dataType}}} value) {
for (final {{classname}} constant : {{classname}}.values()) {
Expand Down
10 changes: 5 additions & 5 deletions target/classes/templates/pojo.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}}{{!
Source: openapi-to-java-records-mustache-templates
Version: 2.4.0
Version: 2.5.0
This template is overriding an official 'openapi-generator-maven-plugin' template.
Expand Down Expand Up @@ -75,7 +75,7 @@
/**
* Gets the {@code value} of this enum.
*
* @return value of this enum
* @return the value of this enum.
*/
public {{{dataType}}} getValue() {
return value;
Expand All @@ -88,9 +88,9 @@
* <p><b>NOTE:</b> if multiple enum constants have a matching value, the first enum constant is
* returned, by the order they are declared.
*
* @param value of the Enum
* @return a {@link {{datatypeWithEnum}} } with the matching value
* @throws IllegalArgumentException if no enum has a value matching the given value
* @param value of the enum.
* @return a {@link {{datatypeWithEnum}} } with the matching value.
* @throws IllegalArgumentException if no enum has a value matching the given value.
*/
public static {{datatypeWithEnum}} fromValue(final {{{dataType}}} value) {
for (final {{datatypeWithEnum}} constant : {{datatypeWithEnum}}.values()) {
Expand Down
2 changes: 1 addition & 1 deletion target/classes/templates/serializableModel.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}}{{!
Source: openapi-to-java-records-mustache-templates
Version: 2.4.0
Version: 2.5.0
This template is a custom template, and is used by `pojo.mustache`.
Expand Down
2 changes: 1 addition & 1 deletion target/classes/templates/useBeanValidation.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}}{{!
Source: openapi-to-java-records-mustache-templates
Version: 2.4.0
Version: 2.5.0
This template is a custom template, and is used by `pojo.mustache`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* openapi-to-java-records-mustache-templates. For further information,
* questions, requesting features or reporting issues, please visit:
* https://github.com/Chrimle/openapi-to-java-records-mustache-templates.
* Generated with Version: 2.4.0
* Generated with Version: 2.5.0
*
*/

Expand Down Expand Up @@ -44,7 +44,7 @@ public enum DeprecatedExampleEnum {
/**
* Gets the {@code value} of this enum.
*
* @return value of this enum
* @return the value of this enum.
*/
public String getValue() {
return value;
Expand All @@ -57,9 +57,9 @@ public String getValue() {
* <p><b>NOTE:</b> if multiple enum constants have a matching value, the first enum constant is
* returned, by the order they are declared.
*
* @param value of the Enum
* @return a {@link DeprecatedExampleEnum } with the matching value
* @throws IllegalArgumentException if no enum has a value matching the given value
* @param value of the enum.
* @return a {@link DeprecatedExampleEnum } with the matching value.
* @throws IllegalArgumentException if no enum has a value matching the given value.
*/
public static DeprecatedExampleEnum fromValue(final String value) {
for (final DeprecatedExampleEnum constant : DeprecatedExampleEnum.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* openapi-to-java-records-mustache-templates. For further information,
* questions, requesting features or reporting issues, please visit:
* https://github.com/Chrimle/openapi-to-java-records-mustache-templates.
* Generated with Version: 2.4.0
* Generated with Version: 2.5.0
*
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* openapi-to-java-records-mustache-templates. For further information,
* questions, requesting features or reporting issues, please visit:
* https://github.com/Chrimle/openapi-to-java-records-mustache-templates.
* Generated with Version: 2.4.0
* Generated with Version: 2.5.0
*
*/

Expand Down Expand Up @@ -50,7 +50,7 @@ public enum ExampleEnum {
/**
* Gets the {@code value} of this enum.
*
* @return value of this enum
* @return the value of this enum.
*/
public String getValue() {
return value;
Expand All @@ -63,9 +63,9 @@ public String getValue() {
* <p><b>NOTE:</b> if multiple enum constants have a matching value, the first enum constant is
* returned, by the order they are declared.
*
* @param value of the Enum
* @return a {@link ExampleEnum } with the matching value
* @throws IllegalArgumentException if no enum has a value matching the given value
* @param value of the enum.
* @return a {@link ExampleEnum } with the matching value.
* @throws IllegalArgumentException if no enum has a value matching the given value.
*/
public static ExampleEnum fromValue(final String value) {
for (final ExampleEnum constant : ExampleEnum.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* openapi-to-java-records-mustache-templates. For further information,
* questions, requesting features or reporting issues, please visit:
* https://github.com/Chrimle/openapi-to-java-records-mustache-templates.
* Generated with Version: 2.4.0
* Generated with Version: 2.5.0
*
*/

Expand Down Expand Up @@ -43,7 +43,7 @@ public enum ExampleEnumWithIntegerValues {
/**
* Gets the {@code value} of this enum.
*
* @return value of this enum
* @return the value of this enum.
*/
public Integer getValue() {
return value;
Expand All @@ -56,9 +56,9 @@ public Integer getValue() {
* <p><b>NOTE:</b> if multiple enum constants have a matching value, the first enum constant is
* returned, by the order they are declared.
*
* @param value of the Enum
* @return a {@link ExampleEnumWithIntegerValues } with the matching value
* @throws IllegalArgumentException if no enum has a value matching the given value
* @param value of the enum.
* @return a {@link ExampleEnumWithIntegerValues } with the matching value.
* @throws IllegalArgumentException if no enum has a value matching the given value.
*/
public static ExampleEnumWithIntegerValues fromValue(final Integer value) {
for (final ExampleEnumWithIntegerValues constant : ExampleEnumWithIntegerValues.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* openapi-to-java-records-mustache-templates. For further information,
* questions, requesting features or reporting issues, please visit:
* https://github.com/Chrimle/openapi-to-java-records-mustache-templates.
* Generated with Version: 2.4.0
* Generated with Version: 2.5.0
*
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* openapi-to-java-records-mustache-templates. For further information,
* questions, requesting features or reporting issues, please visit:
* https://github.com/Chrimle/openapi-to-java-records-mustache-templates.
* Generated with Version: 2.4.0
* Generated with Version: 2.5.0
*
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* openapi-to-java-records-mustache-templates. For further information,
* questions, requesting features or reporting issues, please visit:
* https://github.com/Chrimle/openapi-to-java-records-mustache-templates.
* Generated with Version: 2.4.0
* Generated with Version: 2.5.0
*
*/

Expand Down
Loading

0 comments on commit 3f0abd7

Please sign in to comment.