From 18318968e5ee1f322e01c493fbeddf238e6ceea0 Mon Sep 17 00:00:00 2001 From: Damian Malczewski Date: Tue, 3 Mar 2026 23:37:37 +0100 Subject: [PATCH] Deprecate ProblemStatus enum to mark it internal-only --- .../io/github/problem4j/core/AbstractProblemBuilder.java | 5 +++++ src/main/java/io/github/problem4j/core/ProblemBuilder.java | 5 +++++ src/main/java/io/github/problem4j/core/ProblemStatus.java | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/src/main/java/io/github/problem4j/core/AbstractProblemBuilder.java b/src/main/java/io/github/problem4j/core/AbstractProblemBuilder.java index a946837..fdc7e7b 100644 --- a/src/main/java/io/github/problem4j/core/AbstractProblemBuilder.java +++ b/src/main/java/io/github/problem4j/core/AbstractProblemBuilder.java @@ -126,7 +126,12 @@ public ProblemBuilder status(int status) { * * @param status the {@link ProblemStatus} representing the HTTP status * @return this builder instance for chaining + * @deprecated {@link ProblemStatus} will be considered an internal utility of Problem4J Core and + * will be made package-private in a future major release. The decision was made as each HTTP + * framework most likely has its own enum for HTTP status codes, and there's no real value in + * trying to maintain a separate, framework-agnostic enum that mirrors HTTP status codes. */ + @Deprecated @Override public ProblemBuilder status(@Nullable ProblemStatus status) { return status != null ? status(status.getStatus()) : status(0); diff --git a/src/main/java/io/github/problem4j/core/ProblemBuilder.java b/src/main/java/io/github/problem4j/core/ProblemBuilder.java index 3e18cca..f09cad6 100644 --- a/src/main/java/io/github/problem4j/core/ProblemBuilder.java +++ b/src/main/java/io/github/problem4j/core/ProblemBuilder.java @@ -72,7 +72,12 @@ public interface ProblemBuilder { * * @param status the {@link ProblemStatus} representing the HTTP status * @return this builder instance for chaining + * @deprecated {@link ProblemStatus} will be considered an internal utility of Problem4J Core and + * will be made package-private in a future major release. The decision was made as each HTTP + * framework most likely has its own enum for HTTP status codes, and there's no real value in + * trying to maintain a separate, framework-agnostic enum that mirrors HTTP status codes. */ + @Deprecated ProblemBuilder status(@Nullable ProblemStatus status); /** diff --git a/src/main/java/io/github/problem4j/core/ProblemStatus.java b/src/main/java/io/github/problem4j/core/ProblemStatus.java index 82201ca..d93402a 100644 --- a/src/main/java/io/github/problem4j/core/ProblemStatus.java +++ b/src/main/java/io/github/problem4j/core/ProblemStatus.java @@ -104,7 +104,12 @@ * @see HTTP Cats * @see HTTP response * status codes - HTTP | MDN + * @deprecated {@link ProblemStatus} will be considered an internal utility of Problem4J Core and + * will be made package-private in a future major release. The decision was made as each HTTP + * framework most likely has its own enum for HTTP status codes, and there's no real value in + * trying to maintain a separate, framework-agnostic enum that mirrors HTTP status codes. */ +@Deprecated public enum ProblemStatus { /**