luni, 27 aprilie 2015

[OmniFaces utilities (2.0)] Check if the given string starts with one of the given prefixes


[OmniFaces utilities] The startsWithOneOf() method returns true if the given string starts with one of the given prefixes.

Method:
Usage:

import org.omnifaces.util.Utils;
...
String[] listenersPrefixNames = {"Action", "AjaxBehavior", "Behavior", "ComponentSystemEvent", "ViewMap", "SystemEvent", "ValueChange"};
// returns true
boolean startsWithOneOf = Utils.startsWithOneOf("ComponentSystemEvent", listenersPrefixNames);
// returns false
boolean startsWithOneOf = Utils.startsWithOneOf("Phase", listenersPrefixNames);

Niciun comentariu:

Trimiteți un comentariu