Skip to content

Commit

Permalink
Review HttpStatus validation in command responses
Browse files Browse the repository at this point in the history
Signed-off-by: David Schwilk <david.schwilk@bosch.io>
  • Loading branch information
DerSchwilk committed Dec 16, 2021
1 parent 7c645b5 commit 9f051c4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,44 +62,41 @@ private IllegalAdaptableException(final String errorCode,
}

/**
* Returns a new instance of {@code IllegalAdaptableException} for
* the specified {@code Adaptable} argument.
* Returns a new instance of {@code IllegalAdaptableException}.
*
* @param message the detail message of the exception.
* @param dittoHeaders the {@code DittoHeaders} of the exception.
* @throws NullPointerException if {@code adaptable} is {@code null}.
* @throws NullPointerException if {@code dittoHeaders} is {@code null}.
*/
public IllegalAdaptableException(final String message, final DittoHeaders dittoHeaders) {
public IllegalAdaptableException(@Nullable final String message, final DittoHeaders dittoHeaders) {
this(ERROR_CODE, HTTP_STATUS, dittoHeaders, message, DEFAULT_DESCRIPTION, null, null);
}

/**
* Returns a new instance of {@code IllegalAdaptableException} for
* the specified {@code Adaptable} argument.
* Returns a new instance of {@code IllegalAdaptableException}.
*
* @param message the detail message of the exception.
* @param description the description of the exception.
* @param dittoHeaders the {@code DittoHeaders} of the exception.
* @throws NullPointerException if {@code adaptable} is {@code null}.
* @throws NullPointerException if {@code dittoHeaders} is {@code null}.
*/
public IllegalAdaptableException(final String message,
public IllegalAdaptableException(@Nullable final String message,
@Nullable final String description,
final DittoHeaders dittoHeaders) {

this(ERROR_CODE, HTTP_STATUS, dittoHeaders, message, description, null, null);
}

/**
* Returns a new instance of {@code IllegalAdaptableException} for
* the specified {@code Adaptable} argument.
* Returns a new instance of {@code IllegalAdaptableException}.
*
* @param message the detail message of the exception.
* @param description the description of the exception.
* @param cause the cause of the exception.
* @param dittoHeaders the {@code DittoHeaders} of the exception.
* @throws NullPointerException if {@code adaptable} is {@code null}.
* @throws NullPointerException if {@code dittoHeaders} is {@code null}.
*/
public IllegalAdaptableException(final String message,
public IllegalAdaptableException(@Nullable final String message,
@Nullable final String description,
@Nullable final Throwable cause,
final DittoHeaders dittoHeaders) {
Expand All @@ -112,7 +109,7 @@ public IllegalAdaptableException(final String message,
*
* @param jsonObject the JSON object to be deserialized.
* @param dittoHeaders the headers of the deserialized exception.
* @return the new UnsupportedSignalException.
* @return the new {@code IllegalAdaptableException}.
* @throws NullPointerException if any argument is {@code null}.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if {@code jsonObject} did not contain all mandatory
* fields.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public String toString() {
super.toString() +
", thingId=" + thingId +
", featureId=" + featureId +
", featureCreated=" + feature +
", feature=" + feature +
"]";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public int hashCode() {

@Override
public String toString() {
return getClass().getSimpleName() + " [" + super.toString() + ", thingId=" + thingId + ", featuresCreated=" +
return getClass().getSimpleName() + " [" + super.toString() + ", thingId=" + thingId + ", features=" +
features + "]";
}

Expand Down

0 comments on commit 9f051c4

Please sign in to comment.