Releases: problem4j/problem4j-core
Releases · problem4j/problem4j-core
v2.0.0
Immutable
release. Only release title and notes can be modified.
- Maven:
<dependencies> <dependency> <groupId>io.github.problem4j</groupId> <artifactId>problem4j-core</artifactId> <version>2.0.0</version> </dependency> </dependencies>
- Gradle (Kotlin DSL):
dependencies { implementation("io.github.problem4j:problem4j-core:2.0.0") }
Important
The primary point of release 2.0.0 is refinement and cleanup of the library's public API.
Migration Guide
- Method
Problem.getExtensions()now returnsMap<String, Object>(full unmodifiable map of extensions) instead of extension names. - Method
Problem.getExtensionMembers()was removed - useProblem.getExtensions(). - Method
Problem.getExtensionValue(String)was removed - useProblem.getExtensions().get(Object). - Method
Problem.hasExtension(String)was removed - useProblem.getExtensions().containsKey(Object). - Interface
Problem.Extensionno longer extendsMap.EntryandgetKey()was renamed togetName(). - Enum
ProblemStatuswas removed. - Default
AbstractProblem,AbstractProblemBuilder,AbstractProblemContextandAbstractProblemMapperclasses were removed - library now favors internal default implementations. - Deprecated methods from
ProblemandProblemBuilderwere removed.
Added
- Add
DefaultProblemMapperto replaceAbstractProblemMapperandProblemMapper.create(). - Add
StatusTitleResolverSPI to allow users to provide custom resolution ofstatuscode intotitle. To be used with HTTP status enums depending on the user's framework. - Add
ProblemSupportfor common utilities.
Changed
- Make all methods in
Problem,ProblemBuilderandProblemContextinterfaces non-default. - Make
Problem.Extensionnot extendMap.Entryand instead be a simple data class withnameandvalueproperties. - Reorganize interface
defaultmethods.
Removed
- Remove deprecated methods from
ProblemBuilder. - Minify number of methods in
Problem- plaingetExtensions()returningMap<String, Object>is enough. - Remove deprecated
ProblemStatusenum from public API. The resolution ofstatuscode intotitleis still supported and available for extension viaStatusTitleResolverSPI. - Remove
AbstractProblemclass - useProblemobjects created viaProblem.builder()or static factory methods. Custom implementations ofProblemcan be created by implementing theProbleminterface. - Remove
AbstractProblemBuilderclass - useProblem.builder()static method to get default builder implementation. Custom implementations ofProblemBuildercan be created by implementing theProblemBuilderinterface. - Remove
AbstractProblemContextclass - useProblemContextobjects created viaProblemContext.create()static method. Custom implementations ofProblemContextcan be created by implementing theProblemContextinterface. - Remove
AbstractProblemMapperclass - useDefaultProblemMapperinstead.
v2.0.0-RC1
Immutable
release. Only release title and notes can be modified.
- Maven:
<dependencies> <dependency> <groupId>io.github.problem4j</groupId> <artifactId>problem4j-core</artifactId> <version>2.0.0-RC1</version> </dependency> </dependencies>
- Gradle (Kotlin DSL):
dependencies { implementation("io.github.problem4j:problem4j-core:2.0.0-RC1") }
Important
The primary point of release 2.0.0 is refinement and cleanup of the library's public API. It simplifies the API for Problem by providing a single getExtensions() method for problem extension members management, returning an unmodifiable Map, and drops abstract implementations in favour of keeping most of the the internals as package-private.
Migration guide will be noted for the final 2.0.0 release.
Added
- Add
DefaultProblemMapperto replaceAbstractProblemMapperandProblemMapper.create(). - Add
StatusTitleResolverSPI to allow users to provide custom resolution ofstatuscode intotitle. To be used with HTTP status enums depending on the user's framework. - Add
ProblemSupportfor common utilities.
Changed
- Make all methods in
Problem,ProblemBuilderandProblemContextinterfaces non-default. - Make
Problem.Extensionnot extendMap.Entryand instead be a simple data class withnameandvalueproperties. - Reorganize interface
defaultmethods.
Removed
- Remove deprecated methods from
ProblemBuilder. - Minify number of methods in
Problem- plaingetExtensions()returningMap<String, Object>is enough. - Remove deprecated
ProblemStatusenum from public API. The resolution ofstatuscode intotitleis still supported and available for extension viaStatusTitleResolverSPI. - Remove
AbstractProblemclass - useProblemobjects created viaProblem.builder()or static factory methods. Custom implementations ofProblemcan be created by implementing theProbleminterface. - Remove
AbstractProblemBuilderclass - useProblem.builder()static method to get default builder implementation. Custom implementations ofProblemBuildercan be created by implementing theProblemBuilderinterface. - Remove
AbstractProblemContextclass - useProblemContextobjects created viaProblemContext.create()static method. Custom implementations ofProblemContextcan be created by implementing theProblemContextinterface. - Remove
AbstractProblemMapperclass - useDefaultProblemMapperinstead.
v1.4.3
Immutable
release. Only release title and notes can be modified.
- Maven:
<dependencies> <dependency> <groupId>io.github.problem4j</groupId> <artifactId>problem4j-core</artifactId> <version>1.4.3</version> </dependency> </dependencies>
- Gradle (Kotlin DSL):
dependencies { implementation("io.github.problem4j:problem4j-core:1.4.3") }
Fixed
- Deprecate
ProblemStatus(see JavaDocs for details).
v1.4.2
Immutable
release. Only release title and notes can be modified.
- Maven:
<dependencies> <dependency> <groupId>io.github.problem4j</groupId> <artifactId>problem4j-core</artifactId> <version>1.4.2</version> </dependency> </dependencies>
- Gradle (Kotlin DSL):
dependencies { implementation("io.github.problem4j:problem4j-core:1.4.2") }
Fixed
- Make
ProblemBuilderremove extension member ifnullvalues is passed, instead of silently ignoring it and keeping the previous value. - Cleanup
defaultmethods inProblemBuilderinterface.
v1.4.1
Immutable
release. Only release title and notes can be modified.
- Maven:
<dependencies> <dependency> <groupId>io.github.problem4j</groupId> <artifactId>problem4j-core</artifactId> <version>1.4.1</version> </dependency> </dependencies>
- Gradle (Kotlin DSL):
dependencies { implementation("io.github.problem4j:problem4j-core:1.4.1") }
Fixed
- Change type from
Objectto? extends Object(and@Nullable Objectto? extends @Nullable Object) for generics in method arguments to support covariant arguments.
v1.4.0
Immutable
release. Only release title and notes can be modified.
- Maven:
<dependencies> <dependency> <groupId>io.github.problem4j</groupId> <artifactId>problem4j-core</artifactId> <version>1.4.0</version> </dependency> </dependencies>
- Gradle (Kotlin DSL):
dependencies { implementation("io.github.problem4j:problem4j-core:1.4.0") }
Added
- Add various static
Problem.of(...)factory methods for in-place creation convenience. - Add support for JSpecify annotations for nullability and Kotlin interop.
- Add support for Java Platform Module System if using Java version 9+, due to producing multi-release JAR artifacts.
module org.example.project { requires io.github.problem4j.core; }
v1.4.0-RC1
Immutable
release. Only release title and notes can be modified.
- Maven:
<dependencies> <dependency> <groupId>io.github.problem4j</groupId> <artifactId>problem4j-core</artifactId> <version>1.4.0-RC1</version> </dependency> </dependencies>
- Gradle (Kotlin DSL):
dependencies { implementation("io.github.problem4j:problem4j-core:1.4.0-RC1") }
Added
- Add various static
Problem.of(...)factory methods for in-place creation convenience. - Add support for JSpecify annotations for nullability and Kotlin interop.
- Add support for Java Platform Module System if using Java version 9+, due to producing multi-release JAR artifacts.
module org.example.project { requires io.github.problem4j.core; }
v1.3.3
Immutable
release. Only release title and notes can be modified.
- Maven:
<dependencies> <dependency> <groupId>io.github.problem4j</groupId> <artifactId>problem4j-core</artifactId> <version>1.3.3</version> </dependency> </dependencies>
- Gradle (Kotlin DSL):
dependencies { implementation("io.github.problem4j:problem4j-core:1.3.3") }
Fixed
- Pull back from the idea of returning JSON-alike strings in
toString()methods of this library's classes. While it was nice, sinceContent-Typeis namedapplication/problem+json, these strings were not 100% valid JSONs in all scenarios, and it could be tempting to use it as a response body somewhere. Instead of that,toStringmethods will now produce strings that are simple, useful for logging/debugging and JSON representations should be delegated tojackson-databindandproblem4j-jackson, or any other library that may be supported in the future. - Seal the contract between
toProblemBuildermethod overloading inAbstractProblemMapperby making one methodfinal. Any extensions this logic should be performed by overriding the second method as the first one must only delegate to it.@Override public final ProblemBuilder toProblemBuilder(Throwable t) { return toProblemBuilder(t, null); } @Override public ProblemBuilder toProblemBuilder(Throwable t, ProblemContext context) { // ...
- Re-use instance of default implementation of
ProblemMapperreturned byProblemMapper.create(), because it's thread-safe, stateless and immutable. - Make resolution of deprecated HTTP status codes in
ProblemStatuslazy, by delegating to nested class. - Apply minor improvements to JavaDocs.
v1.3.2
Immutable
release. Only release title and notes can be modified.
- Maven:
<dependencies> <dependency> <groupId>io.github.problem4j</groupId> <artifactId>problem4j-core</artifactId> <version>1.3.2</version> </dependency> </dependencies>
- Gradle (Kotlin DSL):
dependencies { implementation("io.github.problem4j:problem4j-core:1.3.2") }
Fixed
- Resolve confusing naming of
ProblemBuilderinterface methods having singular naming, but actually taking plural arguments (and deprecate old ones). - Apply minor fixes in JavaDocs,
toStringand exception messages.
v1.3.1
Immutable
release. Only release title and notes can be modified.
- Maven:
<dependencies> <dependency> <groupId>io.github.problem4j</groupId> <artifactId>problem4j-core</artifactId> <version>1.3.1</version> </dependency> </dependencies>
- Gradle (Kotlin DSL):
dependencies { implementation("io.github.problem4j:problem4j-core:1.3.1") }
Added
- Override
toStringinAbstractProblemBuilder(probably won't be used but useful in debug mode). - Unify
toStringoverrides ofAbstractProblem,AbstractProblemBuilderandAbstractProblemContextto return output in similar style. - Finalize missing JavaDocs (and fix various existing) - all
publicclasses and methods now have proper JavaDocs. - Annotate
ProblemMappingwith@Documentedso it will appear in JavaDocs.
Changed
- Use
HashMapinstead ofLinkedHashMapforAbstractProblemBuilder, as order of insertion of extension members does not matter.