Skip to content

Commit 039ffc5

Browse files
committed
Update Javadoc to reflect use of record vs lobok @value
1 parent 69f1730 commit 039ffc5

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/main/java/com/codesungrape/hmcts/bookapi/dto/BookRequest.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
import jakarta.validation.constraints.NotBlank;
55

66
/**
7-
* DTO representing the required input for creating or replacing a Book resource. This class mirrors
8-
* the OpenAPI 'BookInput' schema. @Value: Makes fields final, adds constructor, getters, equals,
9-
* hashCode, toString. @NotBlank: Field required; empty/missing value returns 400 Bad Request in
10-
* Spring. @JsonProperty: Maps snake_case JSON to camelCase Java using Jackson.
7+
* DTO representing the required input for creating or replacing a Book resource.
8+
* This record mirrors the OpenAPI 'BookInput' schema.
9+
*As a Java record:
10+
* - all fields are implicitly final
11+
* - a canonical constructor is generated automatically
12+
* - accessor methods (e.g., title()) are generated
13+
* - equals, hashCode, and toString are automatically implemented
14+
*`@NotBlank` ensures that each field is required; missing or empty values result in
15+
* a 400 Bad Request response in Spring.
16+
* `@JsonProperty` maps snake_case JSON to camelCase Java properties using Jackson.
1117
*/
1218
public record BookRequest(
1319
@JsonProperty("title") @NotBlank(message = "Title is required") String title,

0 commit comments

Comments
 (0)