add constructor for non-list argument
package com.linecorp.bot.model;
+import java.util.Collections;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -46,10 +47,18 @@ public class Broadcast {
*/
private final boolean notificationDisabled;
+ public Broadcast(Message messages) {
+ this(Collections.singletonList(messages), false);
+ }
+
public Broadcast(List<Message> messages) {
this(messages, false);
}
+ public Broadcast(Message messages, boolean notificationDisabled) {
+ this(Collections.singletonList(messages), notificationDisabled);
+ }
+
@JsonCreator
public Broadcast(@JsonProperty("messages") List<Message> messages,
@JsonProperty("notificationDisabled") boolean notificationDisabled) {
