diff --git a/pom.xml b/pom.xml index 158fbb0..92b800f 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.sadtech.autoresponder autoresponder - 1.5.0-RELEASE + 1.5.1-SNAPSHOT jar @@ -23,14 +23,14 @@ - 1.2.17 + 1.7.26 - log4j - log4j - ${log4j} + org.slf4j + slf4j-api + ${slf4j.ver} diff --git a/src/main/java/org/sadtech/autoresponder/Autoresponder.java b/src/main/java/org/sadtech/autoresponder/Autoresponder.java index 1dc1ace..f95d38d 100644 --- a/src/main/java/org/sadtech/autoresponder/Autoresponder.java +++ b/src/main/java/org/sadtech/autoresponder/Autoresponder.java @@ -1,11 +1,12 @@ package org.sadtech.autoresponder; -import org.apache.log4j.Logger; import org.sadtech.autoresponder.compare.UnitPriorityComparator; -import org.sadtech.autoresponder.entity.UnitPointer; import org.sadtech.autoresponder.entity.Unit; +import org.sadtech.autoresponder.entity.UnitPointer; import org.sadtech.autoresponder.service.UnitPointerService; import org.sadtech.autoresponder.util.Parser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.HashSet; import java.util.Optional; @@ -15,7 +16,7 @@ import java.util.regex.Pattern; public class Autoresponder { - private static final Logger log = Logger.getLogger(Autoresponder.class); + private static final Logger log = LoggerFactory.getLogger(Autoresponder.class); private Set menuUnits; private UnitPointerService unitPointerService; diff --git a/src/main/java/org/sadtech/autoresponder/entity/Unit.java b/src/main/java/org/sadtech/autoresponder/entity/Unit.java index 66e01b0..1a160e6 100644 --- a/src/main/java/org/sadtech/autoresponder/entity/Unit.java +++ b/src/main/java/org/sadtech/autoresponder/entity/Unit.java @@ -9,21 +9,16 @@ public abstract class Unit { private Set keyWords; private Pattern pattern; - private Integer matchThreshold; - private Integer priority; + private Integer matchThreshold = 10; + private Integer priority = 10; private Set nextUnits; public Unit() { - priority = 10; - matchThreshold = 10; + } - public Unit(Set keyWords, Pattern pattern, Integer matchThreshold, Integer priority, Set nextUnits) { - this.keyWords = keyWords; - this.pattern = pattern; - this.matchThreshold = matchThreshold; - this.priority = priority; - this.nextUnits = nextUnits; + public Unit(Unit... nextUnit) { + nextUnits = new HashSet(nextUnits); } public void setKeyWord(String keyWord) { diff --git a/src/main/java/org/sadtech/autoresponder/service/UnitPointerServiceImpl.java b/src/main/java/org/sadtech/autoresponder/service/UnitPointerServiceImpl.java index ca6f9ad..c9e42f3 100644 --- a/src/main/java/org/sadtech/autoresponder/service/UnitPointerServiceImpl.java +++ b/src/main/java/org/sadtech/autoresponder/service/UnitPointerServiceImpl.java @@ -1,13 +1,14 @@ package org.sadtech.autoresponder.service; -import org.apache.log4j.Logger; import org.sadtech.autoresponder.entity.UnitPointer; import org.sadtech.autoresponder.repository.UnitPointerRepository; import org.sadtech.autoresponder.repository.UnitPointerRepositoryMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class UnitPointerServiceImpl implements UnitPointerService { - private static final Logger log = Logger.getLogger(UnitPointerServiceImpl.class); + private static final Logger log = LoggerFactory.getLogger(UnitPointerServiceImpl.class); private UnitPointerRepository unitPointerRepository;