From 2f05b557060c9e692c928fccc4a2a37eda2130a9 Mon Sep 17 00:00:00 2001 From: Mark Struchkov Date: Sat, 19 Jan 2019 01:36:41 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BD=D0=B5=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D0=BE=D1=83=D1=8E=20lombok=20=D0=B0=D0=BD=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8E=20=D0=BD=D0=B0=20=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D0=BB=D1=8C=D0=BD=D1=83=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 3 ++- .../java/org/sadtech/autoresponder/Autoresponder.java | 8 ++++---- .../autoresponder/service/impl/UnitServiceImpl.java | 6 +++--- .../submodule/{parser => insertwords}/InsertWords.java | 2 +- .../{parser => insertwords}/InsertWordsTest.java | 3 ++- 5 files changed, 12 insertions(+), 10 deletions(-) rename src/main/java/org/sadtech/autoresponder/submodule/{parser => insertwords}/InsertWords.java (95%) rename src/test/java/org/sadtech/autoresponder/submodule/{parser => insertwords}/InsertWordsTest.java (91%) diff --git a/pom.xml b/pom.xml index 0763275..2406501 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.sadtech.autoresponder core - 1.0 + 1.1-SNAPSHOT @@ -41,6 +41,7 @@ ${log4j} + junit diff --git a/src/main/java/org/sadtech/autoresponder/Autoresponder.java b/src/main/java/org/sadtech/autoresponder/Autoresponder.java index d30ea01..da2a281 100644 --- a/src/main/java/org/sadtech/autoresponder/Autoresponder.java +++ b/src/main/java/org/sadtech/autoresponder/Autoresponder.java @@ -1,12 +1,12 @@ package org.sadtech.autoresponder; -import com.sun.istack.internal.NotNull; import lombok.AllArgsConstructor; +import lombok.NonNull; import org.sadtech.autoresponder.entity.Person; import org.sadtech.autoresponder.entity.Unit; import org.sadtech.autoresponder.service.PersonService; import org.sadtech.autoresponder.service.UnitService; -import org.sadtech.autoresponder.submodule.parser.InsertWords; +import org.sadtech.autoresponder.submodule.insertwords.InsertWords; import java.util.List; @@ -16,7 +16,7 @@ public class Autoresponder { private UnitService unitService; private PersonService personService; - public String answer(@NotNull Integer idPerson, @NotNull String message) { + public String answer(@NonNull Integer idPerson, @NonNull String message) { Person person = CheckAndAddPerson(idPerson); Unit unit; if (person.getUnit() == null) { @@ -28,7 +28,7 @@ public class Autoresponder { return unit.getAnswer(); } - public String answer(@NotNull Integer idPerson, @NotNull String message, @NotNull List words) { + public String answer(@NonNull Integer idPerson, @NonNull String message, @NonNull List words) { String answer = answer(idPerson, message); InsertWords insertWords = new InsertWords(); insertWords.setInText(answer); diff --git a/src/main/java/org/sadtech/autoresponder/service/impl/UnitServiceImpl.java b/src/main/java/org/sadtech/autoresponder/service/impl/UnitServiceImpl.java index 3d88777..aa8f8e0 100644 --- a/src/main/java/org/sadtech/autoresponder/service/impl/UnitServiceImpl.java +++ b/src/main/java/org/sadtech/autoresponder/service/impl/UnitServiceImpl.java @@ -1,7 +1,7 @@ package org.sadtech.autoresponder.service.impl; -import com.sun.istack.internal.NotNull; import lombok.AllArgsConstructor; +import lombok.NonNull; import lombok.extern.log4j.Log4j; import org.sadtech.autoresponder.entity.Unit; import org.sadtech.autoresponder.repository.UnitRepository; @@ -17,7 +17,7 @@ public class UnitServiceImpl implements UnitService { private UnitRepository unitRepository; - public Unit nextUnit(Unit unit, @NotNull String message) { + public Unit nextUnit(Unit unit, @NonNull String message) { ArrayList nextUnits = (ArrayList) unit.getNextUnits(); if (nextUnits.size() > 0) { Parser parser = new Parser(); @@ -38,7 +38,7 @@ public class UnitServiceImpl implements UnitService { } @Override - public Unit getUnitById(@NotNull Integer idUnit) { + public Unit getUnitById(@NonNull Integer idUnit) { return unitRepository.getUnitById(idUnit); } diff --git a/src/main/java/org/sadtech/autoresponder/submodule/parser/InsertWords.java b/src/main/java/org/sadtech/autoresponder/submodule/insertwords/InsertWords.java similarity index 95% rename from src/main/java/org/sadtech/autoresponder/submodule/parser/InsertWords.java rename to src/main/java/org/sadtech/autoresponder/submodule/insertwords/InsertWords.java index f44889e..cb9642b 100644 --- a/src/main/java/org/sadtech/autoresponder/submodule/parser/InsertWords.java +++ b/src/main/java/org/sadtech/autoresponder/submodule/insertwords/InsertWords.java @@ -1,4 +1,4 @@ -package org.sadtech.autoresponder.submodule.parser; +package org.sadtech.autoresponder.submodule.insertwords; import lombok.Getter; import lombok.Setter; diff --git a/src/test/java/org/sadtech/autoresponder/submodule/parser/InsertWordsTest.java b/src/test/java/org/sadtech/autoresponder/submodule/insertwords/InsertWordsTest.java similarity index 91% rename from src/test/java/org/sadtech/autoresponder/submodule/parser/InsertWordsTest.java rename to src/test/java/org/sadtech/autoresponder/submodule/insertwords/InsertWordsTest.java index f0d74b5..763bd68 100644 --- a/src/test/java/org/sadtech/autoresponder/submodule/parser/InsertWordsTest.java +++ b/src/test/java/org/sadtech/autoresponder/submodule/insertwords/InsertWordsTest.java @@ -1,8 +1,9 @@ -package org.sadtech.autoresponder.submodule.parser; +package org.sadtech.autoresponder.submodule.insertwords; import org.junit.After; import org.junit.Assert; import org.junit.Test; +import org.sadtech.autoresponder.submodule.insertwords.InsertWords; import java.util.ArrayList;