Рефакторинг

This commit is contained in:
Mark Struchkov 2019-05-08 13:35:27 +03:00
parent 387e091efd
commit e255de1227
7 changed files with 7 additions and 14 deletions

View File

@ -6,7 +6,7 @@
<groupId>org.sadtech.bot</groupId> <groupId>org.sadtech.bot</groupId>
<artifactId>bot-core</artifactId> <artifactId>bot-core</artifactId>
<version>0.5.0-RELEASE</version> <version>0.5.1-SNAPHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<build> <build>

View File

@ -8,7 +8,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
public class EventRepositoryQueue implements EventRepository<JsonObject> { public class EventRepositoryQueue implements EventRepository<JsonObject> {
private Queue<JsonObject> jsonObjects = new ConcurrentLinkedQueue<>(); private final Queue<JsonObject> jsonObjects = new ConcurrentLinkedQueue<>();
@Override @Override
public void add(JsonObject jsonObject) { public void add(JsonObject jsonObject) {

View File

@ -11,7 +11,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
public class MailRepositoryList implements EventRepository<Mail>, MailRepository { public class MailRepositoryList implements EventRepository<Mail>, MailRepository {
private List<Mail> messages = new ArrayList<>(); private final List<Mail> messages = new ArrayList<>();
@Override @Override
public void add(Mail mail) { public void add(Mail mail) {

View File

@ -11,7 +11,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
public class PersonRepositoryMap implements EventRepository<Person>, PersonRepository { public class PersonRepositoryMap implements EventRepository<Person>, PersonRepository {
private Map<Integer, Person> personMap = new HashMap<>(); private final Map<Integer, Person> personMap = new HashMap<>();
@Override @Override
public void add(Person person) { public void add(Person person) {

View File

@ -8,7 +8,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
public class TerminalComandRepositoryQueue implements EventRepository<Mail> { public class TerminalComandRepositoryQueue implements EventRepository<Mail> {
private Queue<Mail> mailQueue = new ConcurrentLinkedQueue<>(); private final Queue<Mail> mailQueue = new ConcurrentLinkedQueue<>();
@Override @Override
public void add(Mail dataObject) { public void add(Mail dataObject) {

View File

@ -15,6 +15,4 @@ public interface RawEventService {
EventRepository getEventRepository(); EventRepository getEventRepository();
void replacementEventRepository(EventRepository eventRepository);
} }

View File

@ -9,9 +9,9 @@ import java.util.Queue;
public class RawEventServiceImpl implements RawEventService { public class RawEventServiceImpl implements RawEventService {
public static final Logger log = Logger.getLogger(RawEventServiceImpl.class); private static final Logger log = Logger.getLogger(RawEventServiceImpl.class);
private EventRepository eventRepository; private final EventRepository eventRepository;
public RawEventServiceImpl(EventRepository eventRepository) { public RawEventServiceImpl(EventRepository eventRepository) {
this.eventRepository = eventRepository; this.eventRepository = eventRepository;
@ -39,9 +39,4 @@ public class RawEventServiceImpl implements RawEventService {
return eventRepository; return eventRepository;
} }
@Override
public void replacementEventRepository(EventRepository eventRepository) {
this.eventRepository = eventRepository;
}
} }