Class SearchOptions.Builder

java.lang.Object
codes.grow.packages.betterstack.logging.SearchOptions.Builder
Enclosing class:
SearchOptions

public static final class SearchOptions.Builder extends Object
Builder for SearchOptions.
  • Method Details

    • start

      public SearchOptions.Builder start(Instant start)
      Sets the range start.
      Parameters:
      start - inclusive start or null
      Returns:
      this builder
    • end

      public SearchOptions.Builder end(Instant end)
      Sets the range end.
      Parameters:
      end - exclusive end or null
      Returns:
      this builder
    • limit

      public SearchOptions.Builder limit(int limit)
      Sets the page size.
      Parameters:
      limit - at least 1
      Returns:
      this builder
    • order

      public SearchOptions.Builder order(SortOrder order)
      Sets the order.
      Parameters:
      order - order
      Returns:
      this builder
    • cursor

      public SearchOptions.Builder cursor(String cursor)
      Sets the page cursor.
      Parameters:
      cursor - cursor or null
      Returns:
      this builder
    • build

      public SearchOptions build()
      Builds the options.
      Returns:
      options
      Throws:
      ValidationException - when the limit is below 1 or the range is reversed