feat: added TelegramParser interface and impl
This commit is contained in:
parent
0dc118e4d7
commit
2af6caf3da
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue