diff --git a/build.gradle b/build.gradle index b90e692..94bcfdf 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ plugins { id 'java' id 'java-library' id 'idea' - id 'io.freefair.lombok' version '6.3.0' + id 'io.freefair.lombok' version '6.4.1' id 'io.github.gradle-nexus.publish-plugin' version '1.1.0' id "nebula.release" version "16.0.0" diff --git a/resulter-core/src/main/java/com/iamceph/resulter/core/model/DataResultableImpl.java b/resulter-core/src/main/java/com/iamceph/resulter/core/model/DataResultableImpl.java index 227839b..65186ac 100644 --- a/resulter-core/src/main/java/com/iamceph/resulter/core/model/DataResultableImpl.java +++ b/resulter-core/src/main/java/com/iamceph/resulter/core/model/DataResultableImpl.java @@ -4,7 +4,6 @@ import com.iamceph.resulter.core.api.ResultStatus; import lombok.EqualsAndHashCode; import lombok.Getter; -import lombok.ToString; import lombok.experimental.Accessors; /** @@ -15,7 +14,6 @@ */ @EqualsAndHashCode(callSuper = false) @Getter -@ToString(callSuper = true) @Accessors(fluent = true) final class DataResultableImpl extends ResultableImpl implements DataResultable { private final T data; @@ -56,4 +54,14 @@ public boolean isFail() { public boolean isWarning() { return status == ResultStatus.WARNING; } + + @Override + public String toString() { return "DataResultable {" + + "data=" + (data != null ? data : "empty") + + ", status=" + status + + ", message='" + (message != null ? message : "empty") + '\'' + + ", error=" + (error != null ? error.getMessage() : "empty") + + '}'; + + } } diff --git a/resulter-core/src/main/java/com/iamceph/resulter/core/model/GroupedResulImpl.java b/resulter-core/src/main/java/com/iamceph/resulter/core/model/GroupedResulImpl.java index 9989643..d506ce4 100644 --- a/resulter-core/src/main/java/com/iamceph/resulter/core/model/GroupedResulImpl.java +++ b/resulter-core/src/main/java/com/iamceph/resulter/core/model/GroupedResulImpl.java @@ -66,7 +66,6 @@ public GroupedResultable merge(Collection resultables) { public List messages() { return resultables.stream() .map(Resultable::message) - .filter(Objects::nonNull) .collect(Collectors.toList()); } @@ -133,4 +132,13 @@ private String toLineMessage() { public ProtoResultable asProto() { return convertor().asProto(); } + + @Override + public String toString() { + return "GroupedResultable {" + + "status=" + status() + + ", message='" + (message().isEmpty() ? message() : "empty") + '\'' + + ", error=" + (error() != null ? error() : "empty") + + '}'; + } } diff --git a/resulter-core/src/main/java/com/iamceph/resulter/core/model/ResultableImpl.java b/resulter-core/src/main/java/com/iamceph/resulter/core/model/ResultableImpl.java index 731857e..a5c4dd2 100644 --- a/resulter-core/src/main/java/com/iamceph/resulter/core/model/ResultableImpl.java +++ b/resulter-core/src/main/java/com/iamceph/resulter/core/model/ResultableImpl.java @@ -9,7 +9,6 @@ * Default implementation of the {@link Resultable} */ @EqualsAndHashCode -@ToString @Getter @Accessors(fluent = true) @RequiredArgsConstructor(access = AccessLevel.PACKAGE) @@ -64,4 +63,13 @@ public K convert(Class target) { public ProtoResultable asProto() { return convertor().asProto(); } + + @Override + public String toString() { + return "Resultable {" + + "status=" + status + + ", message='" + (message != null ? message : "empty") + '\'' + + ", error=" + (error != null ? error.getMessage() : "empty") + + '}'; + } }