Class Event.Builder

  • All Implemented Interfaces:

    
    public class Event.Builder
    
                        

    Event Builder

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

      • Event.Builder

        Event.Builder(String name, String type, String source)
        Builder constructor with required Event attributes as parameters
        Parameters:
        name - required String to be set as event name; should not be null or empty string
        type - required String to be set as event type; should not be null or empty string
        source - required String to be set as event source; should not be null or empty string
      • Event.Builder

        Event.Builder(String name, String type, String source, Array<String> mask)
        Builder constructor with required Event attributes as parameters
        Parameters:
        name - required String to be set as event name; should not be null or empty string
        type - required String to be set as event type; should not be null or empty string
        source - required String to be set as event source; should not be null or empty string
        mask - String[] event mask
    • Method Detail

      • setEventData

         Event.Builder setEventData(Map<String, Object> data)

        Sets the data for this Event. The keys should be of type String.

        Note: Custom classes are not supported as value types. These values will be skipped from the Event data.

        The accepted value types are:

        • Boolean
        • Byte
        • Collection<Object>
        • Double
        • Float
        • Integer
        • String
        • List<Object>
        • Long
        • Map<String, Object>
        • Short
        • null
        Parameters:
        data - Data associated with this Event
        Returns:

        this Event Builder

      • build

         Event build()

        Builds and returns the Event object. It returns null if the event's type or source are null

        Returns:

        the constructed Event or null if the type or source are null

      • inResponseToEvent

         Event.Builder inResponseToEvent(Event requestEvent)

        Sets this as response for requestEvent. Additionally, marks requestEvent as the parent event to this event.

        Parameters:
        requestEvent - Event event
        Returns:

        this Event Builder