Interface GenericResponse<R>

  • All Superinterfaces:
    FFDCResponse
    All Known Implementing Classes:
    SubjectAreaOMASAPIResponse

    public interface GenericResponse<R>
    extends FFDCResponse
    If an OMAS uses Generic types to implement it's Java API, then the responses can implement this interface.
    • Method Detail

      • addAllResults

        void addAllResults​(java.util.Collection<? extends R> results)
        Add several results for the response
        Parameters:
        results - collection with results
      • addResult

        void addResult​(R result)
        Add single result for the response
        Parameters:
        result - - one result
      • results

        java.util.List<R> results()
        Get all results of the response
        Returns:
        results
      • head

        default java.util.Optional<R> head()
        Get head element from result array. Needed when we know for sure that the answer is single object
        Returns:
        result