Class Event

java.lang.Object
net.orbyfied.j8.event.pipeline.Event
Direct Known Subclasses:
BusEvent

public class Event extends Object
Base event class.
  • Constructor Details

    • Event

      public Event()
  • Method Details

    • carry

      public <T> T carry(String key, T val)
      Carries a new key-value pair.
      Parameters:
      key - The key.
      val - The value.
      Returns:
      The value for ease of use.
    • carried

      public <T> T carried(String key)
      Gets the value corresponding with the specified key. Null if it does not exist.
      Parameters:
      key - The key.
      Returns:
      The value or null.
    • carried

      public <T> T carried(String key, Class<T> tClass)
      Gets the value corresponding with the specified key. Null if it does not exist.
      Parameters:
      key - The key.
      tClass - The assumed type of the value.
      Returns:
      The value or null.
    • carried

      public <T> T carried(String key, T def)
      Gets the value corresponding with the specified key. If it is null the "def" parameter is returned.
      Type Parameters:
      T - The return type.
      Parameters:
      key - The key.
      def - The default/else value.
      Returns:
      The value or else the default.
    • carried

      public <T> T carried(String key, Class<T> tClass, T def)
      Gets the value corresponding with the specified key. If it is null the "def" parameter is returned.
      Type Parameters:
      T - The return type.
      Parameters:
      key - The key.
      def - The default/else value.
      Returns:
      The value or else the default.
    • carries

      public boolean carries(String key)
      Checks if it carries the key.
      Parameters:
      key - The key.
      Returns:
      True/false.
    • carried

      public Map<String,Object> carried()
      Returns an immutable map containing all key-value pairs carried.
      Returns:
      The immutable map.