Interface ODataProtocol

All Superinterfaces:
ODataLiteralSerializer, ODataResponseDescriptor
All Known Implementing Classes:
ODataProtocol.ODataProtocolV2, ODataProtocol.ODataProtocolV4

public interface ODataProtocol extends ODataResponseDescriptor, ODataLiteralSerializer
The ODataProtocol defines all necessary information that is needed in order to differentiate between different OData protocol versions.
  • Field Details

    • V2

      static final ODataProtocol V2
      Version 2.0 of the OData protocol.
    • V4

      static final ODataProtocol V4
      Version 4.0 of the OData protocol.
  • Method Details

    • getProtocolVersion

      @Nonnull String getProtocolVersion()
      The version number of this protocol.
      Returns:
      A string representing the OData version, e.g. "4.0"
    • getQueryOptionInlineCount

      @Nonnull Map.Entry<String,String> getQueryOptionInlineCount(boolean optionEnabled)
      Build the (inline) count query option for this protocol version.
      Parameters:
      optionEnabled - Determines the value of the query option.
      Returns:
      An entry to add to the URL query.
    • isEqualTo

      default boolean isEqualTo(@Nonnull ODataProtocol otherProtocol)
      Compares this protocol with the given protocol based on their version identifiers.
      Parameters:
      otherProtocol - The protocol to compare to.
      Returns:
      True, if the protocols resemble the same OData version.