ProtocolWriter : modèle pour règles protocoles d'écriture

This commit is contained in:
Maximilien LEDOUX 2022-02-26 14:41:35 +01:00
parent a883918363
commit 8201d3db91

View File

@ -0,0 +1,23 @@
package lightcontainer.protocol;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public abstract class ProtocolWriter {
private final Pattern rulePattern;
protected ProtocolWriter(String pattern) {
this.rulePattern = Pattern.compile(pattern);
}
public String execute(String data) {
Matcher ruleMatcher = this.rulePattern.matcher(data);
if (ruleMatcher.matches()) {
}
return null;
}
}