Interface OrderByRequestParser

All Known Implementing Classes:
OrderByRequestParserImpl

@InjectableComponent @PublicApi public interface OrderByRequestParser
A component that can parse raw strings into OrderByRequest objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends Enum<T>>
    io.atlassian.fugue.Either<ErrorCollection,OrderByRequest<T>>
    parse(String orderByValue, Class<T> fields)
    Parses a string representing an order by request into the OrderByRequest object.
  • Method Details

    • parse

      <T extends Enum<T>> io.atlassian.fugue.Either<ErrorCollection,OrderByRequest<T>> parse(String orderByValue, Class<T> fields)
      Parses a string representing an order by request into the OrderByRequest object. Works only if field type of the expected order by request is an enum. Expected representation is as follows:

      name
      order by name ascending
      +name
      order by name ascending
      -name
      order by name ascending

      Parsing is case insensitive so the above example will succeed if there is a NAME value in the supplied enum type.

      Type Parameters:
      T - enum type
      Parameters:
      orderByValue - value to parse
      fields - all available fields declared in an enum
      Returns:
      parsed query or an error collection with a proper message