Skip to content

Commit 226203c

Browse files
committed
Fixed checkstyle issues.
Signed-off-by: Tomáš Kraus <[email protected]>
1 parent 2c6c0eb commit 226203c

File tree

6 files changed

+37
-6
lines changed

6 files changed

+37
-6
lines changed

etc/checkstyle-suppressions.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<!--
33
4-
Copyright (c) 2016, 2023 Oracle and/or its affiliates.
4+
Copyright (c) 2016, 2025 Oracle and/or its affiliates.
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -43,4 +43,6 @@
4343
files="examples/openapi-tools/"/>
4444
<suppress checks="HideUtilityClassConstructor"
4545
files="examples/openapi-tools/"/>
46+
<suppress checks="MethodName"
47+
files="examples/data/"/>
4648
</suppressions>

examples/data/mp/src/main/java/io/helidon/examples/data/mp/service/BreedService.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ public BreedService(BreedRepository breedRepository) {
5656

5757
/**
5858
* Handles the {@code GET /} request and returns the index page with endpoint information.
59+
*
60+
* @return the index page with endpoint information
5961
*/
6062
@GET
6163
@Produces(MediaTypes.TEXT_PLAIN_VALUE)
@@ -70,6 +72,8 @@ public String index() {
7072

7173
/**
7274
* Handles the {@code GET /all} request and returns a list of all {@link Breed} entities.
75+
*
76+
* @return the list of all {@link Breed} entities
7377
*/
7478
@GET
7579
@Path("/all")
@@ -83,6 +87,7 @@ public List<Breed> all() {
8387
* the provided name.
8488
*
8589
* @param name the name of the breed
90+
* @return the new {@link Breed} entity
8691
*/
8792
@POST
8893
@Path("/{name}")
@@ -96,6 +101,7 @@ public Breed insert(@PathParam("name") String name) {
96101
* Handles the {@code DELETE /{id}} request and deletes a {@link Breed} entity by its ID.
97102
*
98103
* @param id the id of the breed
104+
* @return the {@link Breed} entity delete operation result
99105
*/
100106
@DELETE
101107
@Path("/{id}")

examples/data/mp/src/main/java/io/helidon/examples/data/mp/service/OwnerService.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ public OwnerService(OwnerRepository ownerRepository) {
5555

5656
/**
5757
* Handles the {@code GET /} request and returns the index page with endpoint information.
58+
*
59+
* @return the index page with endpoint information
5860
*/
5961
@GET
6062
@Produces(MediaTypes.TEXT_PLAIN_VALUE)
@@ -70,6 +72,8 @@ public String index() {
7072

7173
/**
7274
* Handles the {@code GET /all} request and returns a list of all {@link Owner} entities.
75+
*
76+
* @return the list of all {@link Owner} entities
7377
*/
7478
@GET
7579
@Path("/all")
@@ -83,6 +87,7 @@ public List<Owner> all() {
8387
* have a breed with the specified name.
8488
*
8589
* @param breed the name of the pet's breed
90+
* @return the list of owner names
8691
*/
8792
@GET
8893
@Path("/names/{breed}")
@@ -96,6 +101,7 @@ public List<String> namesByBreed(@PathParam("breed") String breed) {
96101
* the provided name.
97102
*
98103
* @param name the name of the owner
104+
* @return the new {@link Owner} entity
99105
*/
100106
@POST
101107
@Path("/{name}")
@@ -110,6 +116,7 @@ public Owner insert(@PathParam("name") String name) {
110116
* the specified ID.
111117
*
112118
* @param id the id of the owner
119+
* @return the {@link Owner} entity delete operation result
113120
*/
114121
@DELETE
115122
@Path("/{id}")

examples/data/mp/src/main/java/io/helidon/examples/data/mp/service/PetService.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ public class PetService {
5656
// Helidon Data repository interface providing Owner entity operations.
5757
private final OwnerRepository ownerRepository;
5858

59+
/**
60+
* Constructs a new {@link PetService} instance.
61+
*
62+
* @param petRepository {@link Pet} entity data repository
63+
* @param breedRepository {@link Breed} entity data repository
64+
* @param ownerRepository {@link Owner} entity data repository
65+
*/
5966
@Inject
6067
public PetService(PetRepository petRepository,
6168
BreedRepository breedRepository,
@@ -67,6 +74,8 @@ public PetService(PetRepository petRepository,
6774

6875
/**
6976
* Handles the {@code GET /} request and returns the index page with endpoint information.
77+
*
78+
* @return the index page with endpoint information
7079
*/
7180
@GET
7281
@Produces(MediaTypes.TEXT_PLAIN_VALUE)
@@ -88,6 +97,8 @@ public String index() {
8897

8998
/**
9099
* Handles the {@code GET /all} request and returns a list of all {@link Pet} entities.
100+
*
101+
* @return the list of all {@link Pet} entities
91102
*/
92103
@GET
93104
@Path("/all")
@@ -103,6 +114,7 @@ public List<Pet> all() {
103114
* The page size is fixed at 5. The page index starts from 0.
104115
*
105116
* @param page the page number, starting from {@code 0}
117+
* @return the paginated list of all {@link Pet} entities
106118
*/
107119
@GET
108120
@Path("/all/{page}")
@@ -117,6 +129,7 @@ public PageDto<Pet> allPage(@PathParam("page") int page) {
117129
* associated with a specific breed name.
118130
*
119131
* @param name the name of the pet's breed
132+
* @return the list of {@link Pet} entities associated with a specific breed name
120133
*/
121134
@GET
122135
@Path("/breed/{name}")
@@ -129,6 +142,7 @@ public List<Pet> breed(@PathParam("name") String name) {
129142
* Handles the {@code GET /get/{name}} request and returns a {@link Pet} entity by its name.
130143
*
131144
* @param name the name of the pet
145+
* @return a {@link Pet} entity with matching name or {@link Optional#empty()} when no such entity exists
132146
*/
133147
@GET
134148
@Path("/get/{name}")
@@ -145,6 +159,7 @@ public Optional<Pet> pet(@PathParam("name") String name) {
145159
* Pet breed and owner records must already exist. Pet entity must not exist in the database.
146160
*
147161
* @param petDto the pet to insert into the database
162+
* @return the new {@link Pet} entity
148163
*/
149164
@POST
150165
@Consumes(MediaTypes.APPLICATION_JSON_VALUE)
@@ -168,6 +183,7 @@ public Pet insert(PetDto petDto) {
168183
* Handles the {@code DELETE /{id}} request and deletes a {@link Pet} entity by its ID.
169184
*
170185
* @param id the id of the pet
186+
* @return the {@link Pet} entity delete operation result
171187
*/
172188
@DELETE
173189
@Path("/{id}")

examples/data/se-declarative/src/main/java/io/helidon/examples/data/se/declarative/service/PetService.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,16 @@
2020

2121
import io.helidon.common.media.type.MediaTypes;
2222
import io.helidon.data.PageRequest;
23-
import io.helidon.data.Slice;
2423
import io.helidon.examples.data.se.declarative.model.Breed;
2524
import io.helidon.examples.data.se.declarative.model.Owner;
2625
import io.helidon.examples.data.se.declarative.model.Pet;
2726
import io.helidon.examples.data.se.declarative.repository.BreedRepository;
2827
import io.helidon.examples.data.se.declarative.repository.OwnerRepository;
2928
import io.helidon.examples.data.se.declarative.repository.PetRepository;
30-
import io.helidon.http.BadRequestException;
3129
import io.helidon.http.Http;
3230
import io.helidon.service.registry.Service;
3331
import io.helidon.transaction.Tx;
3432
import io.helidon.webserver.http.RestServer;
35-
import io.helidon.webserver.http.ServerRequest;
36-
import io.helidon.webserver.http.ServerResponse;
3733

3834
/**
3935
* Service class responsible for handling HTTP requests related to {@link Pet} entities.
@@ -108,6 +104,7 @@ List<Pet> all() {
108104
* The page size is fixed at 5. The page index starts from 0.
109105
*
110106
* @param page the page number, starting from {@code 0}
107+
* @return the paginated list of all {@link Pet} entities
111108
*/
112109
@Http.GET
113110
@Http.Path("/all/{page}")
@@ -122,6 +119,7 @@ PageDto<Pet> allPage(@Http.PathParam("page") int page) {
122119
* associated with a specific breed name.
123120
*
124121
* @param name the name of the pet's breed
122+
* @return the list of {@link Pet} entities associated with a specific breed name
125123
*/
126124
@Http.GET
127125
@Http.Path("/breed/{name}")
@@ -134,6 +132,7 @@ List<Pet> breed(@Http.PathParam("name") String name) {
134132
* Handles the {@code GET /get/{name}} request and returns a {@link Pet} entity by its name.
135133
*
136134
* @param name the name of the pet
135+
* @return a {@link Pet} entity with matching name or {@link Optional#empty()} when no such entity exists
137136
*/
138137
@Http.GET
139138
@Http.Path("/get/{name}")
@@ -150,6 +149,7 @@ Optional<Pet> pet(@Http.PathParam("name") String name) {
150149
* Pet breed and owner records must already exist. Pet entity must not exist in the database.
151150
*
152151
* @param petDto the pet to insert into the database
152+
* @return the new {@link Pet} entity
153153
*/
154154
@Http.POST
155155
@Http.Consumes(MediaTypes.APPLICATION_JSON_VALUE)
@@ -173,6 +173,7 @@ Pet insert(@Http.Entity PetDto petDto) {
173173
* Handles the {@code DELETE /{id}} request and deletes a {@link Pet} entity by its ID.
174174
*
175175
* @param id the id of the pet
176+
* @return the {@link Pet} entity delete operation result
176177
*/
177178
@Http.DELETE
178179
@Http.Path("/{id}")

examples/data/se-imperative/src/main/java/io/helidon/examples/data/se/imperative/service/PetService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import io.helidon.common.media.type.MediaTypes;
1919
import io.helidon.data.PageRequest;
20-
import io.helidon.data.Slice;
2120
import io.helidon.examples.data.se.imperative.model.Breed;
2221
import io.helidon.examples.data.se.imperative.model.Owner;
2322
import io.helidon.examples.data.se.imperative.model.Pet;

0 commit comments

Comments
 (0)