Class EventCastUtil

java.lang.Object
com.saperion.ngc.events.EventCastUtil

public final class EventCastUtil extends Object
Utility class to cast a ZK event Event to needed event class.
  • Method Details

    • cast

      public static <T extends org.zkoss.zk.ui.event.Event> T cast(org.zkoss.zk.ui.event.Event event, Class<T> type)
      Converts the given event to the needed type.

      If cast of event fails a IllegalArgumentException is thrown.

      Type Parameters:
      T - the generic type for the conversion
      Parameters:
      event - the event to convert
      type - the generic type to cast for the given event
      Returns:
      the casted event or throws IllegalArgumentException if cast fails