20 lines
508 B
Java
20 lines
508 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;
|
|
}
|
|
}
|