Introduce action status scoped custom code (#1277)
* Allow providing a custom code with an action status feedback to give more fine grained device specific details. * Add ddi rest docs for new optional status code value. * Provide new code value via mgmt api. Fix review findings. * Fix failing tests Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io> Co-authored-by: Stefan Behl <stefan.behl@bosch.io>
This commit is contained in:
@@ -25,9 +25,13 @@ import org.springframework.util.StringUtils;
|
||||
* update or create builder interface
|
||||
*/
|
||||
public abstract class AbstractActionStatusCreate<T> {
|
||||
|
||||
protected Status status;
|
||||
|
||||
protected Long occurredAt;
|
||||
|
||||
protected Integer code;
|
||||
|
||||
protected List<@ValidString String> messages;
|
||||
|
||||
protected Long actionId;
|
||||
@@ -48,6 +52,12 @@ public abstract class AbstractActionStatusCreate<T> {
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
public T code(final int code) {
|
||||
this.code = code;
|
||||
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
public T messages(final Collection<String> messages) {
|
||||
if (this.messages == null) {
|
||||
this.messages = messages.stream().map(StringUtils::trimWhitespace).collect(Collectors.toList());
|
||||
|
||||
Reference in New Issue
Block a user