Package com.orchestranetworks.dataservices.rest

# Class RESTEncodingHelper

java.lang.Object
com.orchestranetworks.dataservices.rest.RESTEncodingHelper

@Deprecated public final class RESTEncodingHelper extends Object
Deprecated.
since 6.1.0.
Helper for REST encoding.

Since:
  5.7.1 fix D

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `RESTEncodingHelper()`
  Deprecated.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static String`
  `decode(String anEncoded)`
  Deprecated.
  Decodes a given encoded string.
  `static PrimaryKey`
  `decodePrimaryKey(String anEncodedPrimaryKey)`
  Deprecated.
  Decodes an encoded primary key string form into a primary key object.
  `static String`
  `encode(String aString)`
  Deprecated.
  Encodes a given string.
  `static String`
  `encodePrimaryKey(PrimaryKey aPrimaryKey)`
  Deprecated.
  Encodes a given primary key and transforms it into a string.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### RESTEncodingHelper

    public RESTEncodingHelper()
    Deprecated.

- ## Method Details

  - ### encode

    public static String encode(String aString)
    Deprecated.
    Encodes a given string.

    The provided `String` is encoded into the `application/x-www-form-urlencoded` format using the `UTF-8` encoding, then the following characters are replaced:

    - '+' by '_20',
    - '*' by '_2A',
    - '-' by '_2D',
    - '.' by '_2E',
    - '_' by '_5F'
    - '%' by '_'.
    Parameters:
      `aString` - the `String` to encode.
    Returns:
      the encoded `String` or `null`.
    See Also:
      - `decode(String)`
      - `URLEncoder.encode(String, String)`

  - ### encodePrimaryKey

    public static String encodePrimaryKey(PrimaryKey aPrimaryKey)
    Deprecated.
    Encodes a given primary key and transforms it into a string.

    The encoded primary key representation should be used in the `URI` path.

    Parameters:
      `aPrimaryKey` - a primary key to encode.
    Returns:
      the encoded primary key `String` form or `null`.
    See Also:
      - `decodePrimaryKey(String)`
      - `encode(String)`

  - ### decodePrimaryKey

    public static PrimaryKey decodePrimaryKey(String anEncodedPrimaryKey) throws UnsupportedEncodingException
    Deprecated.
    Decodes an encoded primary key string form into a primary key object.
    Parameters:
      `anEncodedPrimaryKey` - an encoded primary key to decode.
    Returns:
      the decoded primary key `Object` or `null`.
    Throws:
      `UnsupportedEncodingException` - if `anEncodedPrimaryKey` cannot be decoded.
    See Also:
      - `decode(String)`
      - `encodePrimaryKey(PrimaryKey)`
      - `PrimaryKey.parseString(String)`

  - ### decode

    public static String decode(String anEncoded) throws UnsupportedEncodingException
    Deprecated.
    Decodes a given encoded string.

    The provided `String` is decoded from an `application/x-www-form-urlencoded` format, using `UTF-8` encoding, after the substitution of the following characters:

    - '_' by '%',
    - '_5F' by '_',
    - '_2A' by '*',
    - '_2D' by '-',
    - '_2E' by '.'
    Parameters:
      `anEncoded` - the encoded `String`.
    Returns:
      the decoded `String`.
    Throws:
      `UnsupportedEncodingException` - if `anEncoded` cannot be decoded.
    See Also:
      - `URLDecoder.decode(String, String)`