-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13529 from gsmet/rework-inheritance
Rework constrained method inheritance for Hibernate Validator extension
- Loading branch information
Showing
6 changed files
with
84 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...e-validator/src/main/java/io/quarkus/it/hibernate/validator/inheritance/BookResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.quarkus.it.hibernate.validator.inheritance; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.QueryParam; | ||
import javax.ws.rs.core.MediaType; | ||
|
||
public interface BookResource { | ||
|
||
String PATH = "/books"; | ||
|
||
@GET | ||
@Produces(MediaType.TEXT_PLAIN) | ||
String hello(@NotNull @QueryParam("name") String name); | ||
} |
10 changes: 10 additions & 0 deletions
10
...ator/src/main/java/io/quarkus/it/hibernate/validator/inheritance/ScienceBookResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package io.quarkus.it.hibernate.validator.inheritance; | ||
|
||
import javax.ws.rs.Path; | ||
|
||
@Path(ScienceBookResource.PATH) | ||
public interface ScienceBookResource extends BookResource { | ||
|
||
String PATH = BookResource.PATH + "/science"; | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
.../src/main/java/io/quarkus/it/hibernate/validator/inheritance/ScienceBookResourceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package io.quarkus.it.hibernate.validator.inheritance; | ||
|
||
public class ScienceBookResourceImpl implements ScienceBookResource { | ||
|
||
@Override | ||
public String hello(String name) { | ||
return "Hello " + name; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters