Class BeaconEvent


  • public class BeaconEvent
    extends Object
    Represents an event fired by beacons
    • Method Detail

      • getBeacon

        public String getBeacon()
        Returns the beacon name.
        Returns:
        the beacon name
      • getMinionId

        public String getMinionId()
        Returns the id of the minion that triggered the beacon
        Returns:
        the minion id
      • getAdditional

        public String getAdditional()
        Provides additional information from the tag depending on the type of beacon
        Returns:
        additional information
      • getData

        public <R> R getData​(com.google.gson.reflect.TypeToken<R> type)
        Return the event data parsed into the given type.
        Type Parameters:
        R - type to parse the data into
        Parameters:
        type - type token to parse data
        Returns:
        the event data
      • getData

        public <R> R getData​(Class<R> type)
        Return this event's data parsed into the given type.
        Type Parameters:
        R - type to parse the data into
        Parameters:
        type - class to parse data
        Returns:
        the data
      • getData

        public Map<String,​Object> getData()
        Return event data as Map
        Returns:
        event data as map
      • parse

        public static Optional<BeaconEvent> parse​(Event event)
        Utility method to parse e generic event to a more specific one
        Parameters:
        event - the generic event to parse
        Returns:
        an option containing the parsed value or non if it could not be parsed