From c3997008a54213cbed71a43a241f4bd79a39e492 Mon Sep 17 00:00:00 2001 From: Mark Struchkov Date: Fri, 12 Jul 2019 17:15:14 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=BE=D0=B2=D0=B0=D1=8F=20=D0=BB=D0=BE?= =?UTF-8?q?=D0=B3=D0=B8=D0=BA=D0=B0=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D1=8E=D0=BD=D0=B8=D1=82=D0=BE=D0=B2=20-=20?= =?UTF-8?q?=D0=9C=D0=B5=D0=B3=D0=B0=D0=91=D0=B8=D0=BB=D0=B4=D0=B5=D1=80=20?= =?UTF-8?q?=D0=9D=D0=BE=D0=B2=D0=B0=D1=8F=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=B2=D0=B0=D0=BB=D0=B8=D0=B4=D0=B0=D1=86=D0=B8=D0=B8?= =?UTF-8?q?=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20=D0=BE=D1=82=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=9F=D1=80=D0=BE=D0=B4=D0=BE=D0=BB=D0=B6=D0=B0=D1=8E?= =?UTF-8?q?=20=D0=B2=D0=BD=D0=B5=D0=B4=D1=80=D1=8F=D1=82=D1=8C=20=D0=BB?= =?UTF-8?q?=D0=BE=D0=BC=D0=B1=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sadtech/social/core/domain/BoxAnswer.java | 61 ++----------------- 1 file changed, 5 insertions(+), 56 deletions(-) diff --git a/src/main/java/org/sadtech/social/core/domain/BoxAnswer.java b/src/main/java/org/sadtech/social/core/domain/BoxAnswer.java index de38213..6247fc8 100644 --- a/src/main/java/org/sadtech/social/core/domain/BoxAnswer.java +++ b/src/main/java/org/sadtech/social/core/domain/BoxAnswer.java @@ -1,7 +1,9 @@ package org.sadtech.social.core.domain; +import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; +import lombok.Setter; import lombok.ToString; import org.sadtech.social.core.domain.content.attachment.GeoCoordinate; import org.sadtech.social.core.domain.keyboard.KeyBoard; @@ -15,13 +17,15 @@ import org.sadtech.social.core.utils.Description; @EqualsAndHashCode @ToString @Getter +@Builder(toBuilder = true) public class BoxAnswer { + @Setter @Description("Обычное текстовое сообщение") private String message; @Description("Клавиатура - меню") - private KeyBoard keyboard; + private KeyBoard keyBoard; @Description("Географические координаты") private GeoCoordinate coordinates; @@ -29,59 +33,4 @@ public class BoxAnswer { @Description("Идентификатор стикера") private Integer stickerId; - private BoxAnswer() { - - } - - private BoxAnswer(BoxAnswer target) { - if (target != null) { - this.message = target.getMessage(); - this.keyboard = target.getKeyboard(); - this.coordinates = target.getCoordinates(); - this.stickerId = target.getStickerId(); - } - } - - public void setMessage(String message) { - this.message = message; - } - - public BoxAnswer prototype() { - return new BoxAnswer(this); - } - - public static Builder builder() { - return new BoxAnswer().new Builder(); - } - - public class Builder { - private Builder() { - - } - - public Builder message(String message) { - BoxAnswer.this.message = message; - return this; - } - - public Builder keyBoard(KeyBoard keyBoard) { - BoxAnswer.this.keyboard = keyBoard; - return this; - } - - public Builder coordinate(Float lat, Float aLong) { - BoxAnswer.this.coordinates = new GeoCoordinate(lat, aLong); - return this; - } - - public Builder steckerId(Integer stickerId) { - BoxAnswer.this.stickerId = stickerId; - return this; - } - - public BoxAnswer build() { - return BoxAnswer.this; - } - } - }