Interface PayloadSubsectionExtractor<T extends PayloadSubsectionExtractor<T>>

Type Parameters:
T - the subsection extractor subclass
All Known Implementing Classes:
FieldPathPayloadSubsectionExtractor

public interface PayloadSubsectionExtractor<T extends PayloadSubsectionExtractor<T>>
Strategy interface for extracting a subsection of a payload.
Since:
1.2.0
Author:
Andy Wilkinson
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    extractSubsection(byte[] payload, org.springframework.http.MediaType contentType)
    Extracts a subsection of the given payload that has the given contentType.
    default byte[]
    extractSubsection(byte[] payload, org.springframework.http.MediaType contentType, List<FieldDescriptor> descriptors)
    Extracts a subsection of the given payload that has the given contentType and that is described by the given descriptors.
    Returns an identifier for the subsection that this extractor will extract.
    withSubsectionId(String subsectionId)
    Returns an extractor with the given subsectionId.
  • Method Details

    • extractSubsection

      byte[] extractSubsection(byte[] payload, org.springframework.http.MediaType contentType)
      Extracts a subsection of the given payload that has the given contentType.
      Parameters:
      payload - the payload
      contentType - the content type of the payload
      Returns:
      the subsection of the payload
    • extractSubsection

      default byte[] extractSubsection(byte[] payload, org.springframework.http.MediaType contentType, List<FieldDescriptor> descriptors)
      Extracts a subsection of the given payload that has the given contentType and that is described by the given descriptors.
      Parameters:
      payload - the payload
      contentType - the content type of the payload
      descriptors - descriptors that describe the payload
      Returns:
      the subsection of the payload
      Since:
      2.0.4
    • getSubsectionId

      String getSubsectionId()
      Returns an identifier for the subsection that this extractor will extract.
      Returns:
      the identifier
    • withSubsectionId

      T withSubsectionId(String subsectionId)
      Returns an extractor with the given subsectionId.
      Parameters:
      subsectionId - the subsection ID
      Returns:
      the customized extractor