19 lines
504 B
Java
19 lines
504 B
Java
|
|
package org.openautonomousconnection.luascript.events;
|
||
|
|
|
||
|
|
import java.util.Locale;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Normalizes event names.
|
||
|
|
*/
|
||
|
|
public final class UiEventRegistry {
|
||
|
|
|
||
|
|
private UiEventRegistry() { }
|
||
|
|
|
||
|
|
public static String normalize(String eventName) {
|
||
|
|
if (eventName == null) throw new IllegalArgumentException("eventName is null");
|
||
|
|
String e = eventName.trim().toLowerCase(Locale.ROOT);
|
||
|
|
if (e.isEmpty()) throw new IllegalArgumentException("eventName is empty");
|
||
|
|
return e;
|
||
|
|
}
|
||
|
|
}
|