Package org.instancio

Interface FeedApi

All Known Subinterfaces:
InstancioFeedApi<F>

@ExperimentalApi public interface FeedApi
Interface for configuring Feed instances.
Since:
5.0.0
See Also:
  • Method Details

    • formatOptions

      Specifies the data format options of a Feed, for example:
      
       SampleFeed feed = Instancio.ofFeed(SampleFeed.class)
           .formatOptions(format -> format.csv()
               .commentPrefix("#")
               .delimiter('|')
               .trimValues(true))
           .create();
       
      Parameters:
      provider - of format options
      Returns:
      API builder reference
      Since:
      5.0.0
    • formatType

      @ExperimentalApi FeedApi formatType(FeedFormatType feedFormatType)
      Specifies the data format type for the feed, such as CSV (by default) or JSON, for example:
      
       SampleFeed feed = Instancio.ofFeed(SampleFeed.class)
           .formatType(FeedFormatType.JSON)
           .create();
       
      Parameters:
      feedFormatType - the data format type
      Returns:
      API builder reference
      Since:
      5.0.0
    • dataAccess

      @ExperimentalApi FeedApi dataAccess(FeedDataAccess feedDataAccess)
      Specifies the data access mode for the feed (sequential or random).

      The default is determined by the Keys.FEED_DATA_ACCESS setting value.

      Parameters:
      feedDataAccess - the data access mode
      Returns:
      API builder reference
      Since:
      5.0.0
    • onDataEnd

      @ExperimentalApi FeedApi onDataEnd(FeedDataEndAction feedDataEndAction)
      Specifies the action to take when the end of the data feed is reached.
      Parameters:
      feedDataEndAction - the strategy for handling end-of-data
      Returns:
      API builder reference
      Since:
      5.0.0
    • withTagKey

      @ExperimentalApi FeedApi withTagKey(String tagKey)
      Specifies the tag key for filtering records in the data feed.
      Parameters:
      tagKey - the key used to tag records
      Returns:
      API builder reference
      Since:
      5.0.0
    • withTagValue

      @ExperimentalApi FeedApi withTagValue(String tagValue)
      Specifies the tag value of the records to fetch.
      Parameters:
      tagValue - the value of the tag to filter records by
      Returns:
      API builder reference
      Since:
      5.0.0