Skip to content

Commit d7bb0e3

Browse files
Update javadoc
1 parent 4057b43 commit d7bb0e3

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ public interface ProblemBuilder {
111111
ProblemBuilder extension(@Nullable String name, @Nullable Object value);
112112

113113
/**
114-
* Adds multiple custom extensions from a map.
114+
* Adds multiple custom extensions from a map. If the value of any provided extension is {@code
115+
* null} and an extension with the same key already exists, it will be removed.
115116
*
116117
* @param extensions map of extension keys and values
117118
* @return this builder instance for chaining
@@ -124,7 +125,9 @@ default ProblemBuilder extensions(@Nullable Map<String, ? extends @Nullable Obje
124125
}
125126

126127
/**
127-
* Adds single custom extension from {@link Problem.Extension}.
128+
* Adds single custom extension from {@link Problem.Extension}. If the value of the provided
129+
* extension is {@code null} and an extension with the same key already exists, it will be
130+
* removed.
128131
*
129132
* @param extension array of extensions
130133
* @return this builder instance for chaining
@@ -137,7 +140,9 @@ default ProblemBuilder extension(Problem.@Nullable Extension extension) {
137140
}
138141

139142
/**
140-
* Adds multiple custom extensions from varargs of {@link Problem.Extension}.
143+
* Adds multiple custom extensions from varargs of {@link Problem.Extension}. If the value of any
144+
* provided extension is {@code null} and an extension with the same key already exists, it will
145+
* be removed.
141146
*
142147
* @param extensions array of extensions
143148
* @return this builder instance for chaining
@@ -154,7 +159,9 @@ default ProblemBuilder extensions(Problem.@Nullable Extension @Nullable ... exte
154159
}
155160

156161
/**
157-
* Adds multiple custom extensions from a collection of {@link Problem.Extension}.
162+
* Adds multiple custom extensions from a collection of {@link Problem.Extension}. If the value of
163+
* any provided extension is {@code null} and an extension with the same key already exists, it
164+
* will be removed.
158165
*
159166
* @param extensions collection of extensions
160167
* @return this builder instance for chaining

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public interface ProblemMapper {
5656
* <p>Note that because default implementation is thread-safe and stateless, since {@code v1.3.3}
5757
* this method returns a singleton instance.
5858
*
59-
* @return a new {@link ProblemMapper} instance
59+
* @return default implementation of {@link ProblemMapper}
6060
*/
6161
static ProblemMapper create() {
6262
return ProblemMapperImpl.INSTANCE;

src/test/java/io/github/problem4j/core/AbstractProblemTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ void givenUnknownStatus_whenFindTitle_thenReturnsUnknownTitle() {
148148
assertThat(problem.getTitle()).isEqualTo(Problem.UNKNOWN_TITLE);
149149
}
150150

151+
@SuppressWarnings("deprecation")
151152
@Test
152153
void givenExtension_whenSetValue_thenValueIsUpdated() {
153154
Problem.Extension ext = new AbstractProblem.AbstractExtension("key", "original") {};

0 commit comments

Comments
 (0)