Class ODataFunctionParameters

java.lang.Object
com.sap.cloud.sdk.datamodel.odata.client.request.AbstractODataParameters
com.sap.cloud.sdk.datamodel.odata.client.request.ODataFunctionParameters

public class ODataFunctionParameters extends AbstractODataParameters
Fluent API class to build and hold function parameters.
  • Constructor Details

    • ODataFunctionParameters

      public ODataFunctionParameters(@Nonnull ODataProtocol protocol)
      Create a new, empty set of parameters for an OData function.
      Parameters:
      protocol - The ODataProtocol version the parameters should conform to.
  • Method Details

    • of

      @Nonnull public static ODataFunctionParameters of(@Nonnull Map<String,Object> parameters, @Nonnull ODataProtocol protocol)
      Create an instance of ODataFunctionParameters from a set of parameters.
      Parameters:
      parameters - Key-value pairs for parameter values.
      protocol - The ODataProtocol version these parameters should conform to.
      Returns:
      A new instance of ODataFunctionParameters.
      Throws:
      IllegalArgumentException - When the map contains a primitive type that is not supported.
      See Also:
    • empty

      @Nonnull public static ODataFunctionParameters empty(@Nonnull ODataProtocol protocol)
      Convenience method to create an empty set of function parameters.
      Parameters:
      protocol - The OData protocol version that the parameters should conform to.
      Returns:
      A new instance of ODataFunctionParameters
    • addParameter

      @Nonnull public <PrimitiveT> ODataFunctionParameters addParameter(@Nonnull String parameterName, @Nullable PrimitiveT value)
      Add a parameter to function parameters.
      Type Parameters:
      PrimitiveT - Type of the primitive value.
      Parameters:
      parameterName - Name of the property (derived from the EDMX)
      value - Property value, assumed to be a primitive.
      Returns:
      The modified instance.
      Throws:
      IllegalArgumentException - When a parameter by that idenfitier already exists or primitive type is not supported.
    • toEncodedString

      @Nonnull public String toEncodedString()
      Serializes all parameters into an encoded URL path segment. The format is as follows:

      • An empty set of parameters will yield ()
      • One or more parameters will yield (key1=val,key2=val)

      Overrides:
      toEncodedString in class AbstractODataParameters
      Returns:
      Encoded URL string representation of the parameters.
    • toEncodedString

      @Nonnull public String toEncodedString(@Nonnull UriEncodingStrategy strategy)
      Serializes all parameters into an encoded URL path segment. The format is as follows:

      • An empty set of parameters will yield ()
      • One or more parameters will yield (key1=val,key2=val)

      Overrides:
      toEncodedString in class AbstractODataParameters
      Parameters:
      strategy - The URI encoding strategy.
      Returns:
      Encoded URL string representation of the parameters.
    • toString

      @Nonnull public String toString()
      Serializes all parameters into an unencoded URL path segment. The format is as follows:

      • An empty set of parameters will yield ()
      • One or more parameters will yield (key1=val,key2=val)

      Overrides:
      toString in class AbstractODataParameters
      Returns:
      String representation of the parameters.