Package org.instancio
Interface FeedApi
- All Known Subinterfaces:
InstancioFeedApi<F>
Interface for configuring
Feed instances.- Since:
- 5.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondataAccess(FeedDataAccess feedDataAccess) Specifies the data access mode for the feed (sequential or random).formatOptions(FormatOptionsProvider provider) Specifies the data format options of aFeed, for example:formatType(FeedFormatType feedFormatType) Specifies the data format type for the feed, such as CSV (by default) or JSON, for example:onDataEnd(FeedDataEndAction feedDataEndAction) Specifies the action to take when the end of the data feed is reached.withTagKey(String tagKey) Specifies the tag key for filtering records in the data feed.withTagValue(String tagValue) Specifies the tag value of the records to fetch.
-
Method Details
-
formatOptions
Specifies the data format options of aFeed, 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
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
Specifies the data access mode for the feed (sequential or random).The default is determined by the
Keys.FEED_DATA_ACCESSsetting value.- Parameters:
feedDataAccess- the data access mode- Returns:
- API builder reference
- Since:
- 5.0.0
-
onDataEnd
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
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
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
-