Reflect review: I suggest to delombok this constructor for readability.
@@ -19,13 +19,17 @@ package com.linecorp.bot.model.message;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
-import lombok.AllArgsConstructor;
import lombok.Value;
@Value
-@AllArgsConstructor(onConstructor = @__(@JsonCreator))
-// Constructor which has only one argument needs `@JsonCreator`
@JsonTypeName("text")
public class TextMessage implements Message {
private final String text;
+
+ @JsonCreator
+ // Constructor which has only one argument needs Jackson Annotation.
+ // see MessageJsonReconstructionTest for detail.
+ public TextMessage(final String text) {
+ this.text = text;
+ }
}
