feat: added TelegramParser interface and impl

This commit is contained in:
dancingCycle 2022-01-05 08:34:50 -05:00
parent 0dc118e4d7
commit 2af6caf3da
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,17 @@
package de.swingbe.ifleet;
import de.swingbe.ifleet.model.Entity;
/**
* Parses an {@link de.swingbe.ifleet.model.Entity}.
*/
public interface TelegramParser {
/**
* Returns a new {@link Entity} that holds the parses telegram.
*
* @param input the {@link String} to be parsed
* @return the parsed {@link Entity}
*/
Entity parse(String input);
}

View File

@ -0,0 +1,20 @@
package de.swingbe.ifleet;
import de.swingbe.ifleet.model.Entity;
import static de.swingbe.ifleet.model.EntityParser.parseLogEntry;
/**
* Parse telegram.
*
* Note that this class is package-private, so that the client can not use it.
*/
class TelegramParserImpl implements TelegramParser {
TelegramParserImpl() {
}
@Override
public Entity parse(String input) {
return parseLogEntry(input);
}
}