Skip to content

Commit 9f8764f

Browse files
Deprecate ProblemStatus enum to mark it internal-only (#34)
1 parent b4868c9 commit 9f8764f

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/main/java/io/github/problem4j/core/AbstractProblemBuilder.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,12 @@ public ProblemBuilder status(int status) {
126126
*
127127
* @param status the {@link ProblemStatus} representing the HTTP status
128128
* @return this builder instance for chaining
129+
* @deprecated {@link ProblemStatus} will be considered an internal utility of Problem4J Core and
130+
* will be made package-private in a future major release. The decision was made as each HTTP
131+
* framework most likely has its own enum for HTTP status codes, and there's no real value in
132+
* trying to maintain a separate, framework-agnostic enum that mirrors HTTP status codes.
129133
*/
134+
@Deprecated
130135
@Override
131136
public ProblemBuilder status(@Nullable ProblemStatus status) {
132137
return status != null ? status(status.getStatus()) : status(0);

src/main/java/io/github/problem4j/core/ProblemBuilder.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ public interface ProblemBuilder {
7272
*
7373
* @param status the {@link ProblemStatus} representing the HTTP status
7474
* @return this builder instance for chaining
75+
* @deprecated {@link ProblemStatus} will be considered an internal utility of Problem4J Core and
76+
* will be made package-private in a future major release. The decision was made as each HTTP
77+
* framework most likely has its own enum for HTTP status codes, and there's no real value in
78+
* trying to maintain a separate, framework-agnostic enum that mirrors HTTP status codes.
7579
*/
80+
@Deprecated
7681
ProblemBuilder status(@Nullable ProblemStatus status);
7782

7883
/**

src/main/java/io/github/problem4j/core/ProblemStatus.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,12 @@
104104
* @see <a href="https://http.cat/">HTTP Cats</a>
105105
* @see <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status">HTTP response
106106
* status codes - HTTP | MDN</a>
107+
* @deprecated {@link ProblemStatus} will be considered an internal utility of Problem4J Core and
108+
* will be made package-private in a future major release. The decision was made as each HTTP
109+
* framework most likely has its own enum for HTTP status codes, and there's no real value in
110+
* trying to maintain a separate, framework-agnostic enum that mirrors HTTP status codes.
107111
*/
112+
@Deprecated
108113
public enum ProblemStatus {
109114

110115
/**

0 commit comments

Comments
 (0)