Github user dawidwys commented on the issue:
https://github.com/apache/flink/pull/3477
Thanks @kl0u for the comment. I was wondering if it would be possible(and
beneficial) to restrict it on the interface level and come up with a class
hierachy like :
```java
interface IPattern {
/**
Getters for properties e.g.
*/
String getName()
Quantifier getQuantifier()
}
class Pattern implements IPattern {
public Pattern<T, F> where(FilterFunction<F> newFilterFunction)
public Pattern<T, F> where(FilterFunction<F> newFilterFunction)
public QuantifiedPattern<T, F> zeroOrMore(final boolean eager)
...
}
class QuantifiedPattern implements IPattern {
private Pattern<T, F> wrappedPattern;
public QuantifiedPattern<T, F> where(FilterFunction<F>
newFilterFunction)
public String getName() {
return wrappedPattern.getName();
}
public String getQuantifier() {
return wrappedPattern.getQuantifier();
}
/* no quantifier specific methods */
}
```
You can see a working example for java-cep in my fork:
https://github.com/dawidwys/flink/tree/cepQuantifierAPI
Not sure if the hierarchy is not too complex, and simple checks with
exceptions would be better.
We would also need to duplicate this hierarchy in the scala part.
@kl0u What do you think?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---