Class IntentEvent

    • Constructor Detail

      • IntentEvent

        public IntentEvent​(IntentEvent.Type type,
                           Intent intent,
                           long time)
        Creates an event of a given type and for the specified intent and the current time.
        Parameters:
        type - event type
        intent - subject intent
        time - time the event created in milliseconds since start of epoch
      • IntentEvent

        public IntentEvent​(IntentEvent.Type type,
                           Intent intent)
        Creates an event of a given type and for the specified intent and the current time.
        Parameters:
        type - event type
        intent - subject intent
    • Method Detail

      • getEvent

        public static Optional<IntentEvent> getEvent​(IntentData data)
        Creates an IntentEvent based on the state contained in the given intent data. Some states are not sent as external events, and these states will return null events.
        Parameters:
        data - the intent data to create an event for
        Returns:
        new intent event if the state is valid, otherwise null.
      • getEvent

        public static Optional<IntentEvent> getEvent​(IntentState state,
                                                     Intent intent)
        Creates an IntentEvent based on the given state and intent. Some states are not sent as external events, and these states will return null events.
        Parameters:
        state - new state of the intent
        intent - intent to put in event
        Returns:
        new intent event if the state is valid, otherwise null.