Hi,
why is Components
public final List<IBehavior> getBehaviors()
public
and why is
protected List<IBehavior> getBehaviors(Class<? extends IBehavior> type)
protected?
For example for a Behavior I'd like it to be able to tell if an
Behavior of its type is already bound to that component.
In its bind() method I'd like to do something like:
if (component.getBehaviors(SomeBehavior.class).size() > 1) {
throw new Error("Ther may only be one");
}
But I have to do something like:
for (IBehavior behavior : component.getBehaviors()) {
if (behavior instanceof SomeBehavior) {
throw new Error("There may only be one");
}
}
So my whish would be to have em both public. I wouldn't mind seeing em
both final, but that might break existing code.
mf