2026-01-16 21:47:04 +01:00
|
|
|
package org.openautonomousconnection.luascript.events;
|
|
|
|
|
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Event passed from host into Lua.
|
|
|
|
|
*/
|
2026-01-16 21:53:46 +01:00
|
|
|
public record UiEvent(String targetId, String type, Map<String, Object> data) {
|
2026-01-16 21:47:04 +01:00
|
|
|
|
|
|
|
|
public UiEvent(String targetId, String type, Map<String, Object> data) {
|
|
|
|
|
this.targetId = Objects.requireNonNull(targetId, "targetId");
|
|
|
|
|
this.type = Objects.requireNonNull(type, "type");
|
|
|
|
|
this.data = (data == null) ? Collections.emptyMap() : Collections.unmodifiableMap(data);
|
|
|
|
|
}
|
|
|
|
|
}
|