Interface EventStream.Protocol<ParsedT,​ItemT>

  • Enclosing class:
    EventStream<ResponseT extends AsyncResponse,​ItemT>

    public static interface EventStream.Protocol<ParsedT,​ItemT>
    Protocol interface that defines how to parse and process different event stream formats
    • Method Detail

      • processItem

        ItemT processItem​(ParsedT parsed,
                          com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                          com.fasterxml.jackson.core.type.TypeReference<ItemT> typeReference)
                   throws java.lang.Exception
        Process a parsed item and convert it to the target type
        Parameters:
        parsed - the parsed item from the parser
        objectMapper - the ObjectMapper for deserialization
        typeReference - the target type reference
        Returns:
        the converted item, or null if this item should be skipped
        Throws:
        java.lang.Exception - if conversion fails
      • shouldStop

        boolean shouldStop​(ParsedT parsed)
        Check if processing should stop (e.g., terminal message encountered)
        Parameters:
        parsed - the parsed item
        Returns:
        true if processing should stop