org.apache.olingo.server.api.uri

## Interface UriHelper

-     public interface UriHelper

  Used for URI-related tasks.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `buildCanonicalURL(EdmEntitySet edmEntitySet, Entity entity)` Builds the relative canonical URL for the given entity in the given entity set.
    `String` | `buildContextURLKeyPredicate(List<UriParameter> keys)` Builds the key-predicate part of a `ContextURL`.
    `String` | `buildContextURLSelectList(EdmStructuredType type, ExpandOption expand, SelectOption select)` Builds the select-list part of a `ContextURL`.
    `String` | `buildKeyPredicate(EdmEntityType edmEntityType, Entity entity)` Builds the key predicate for the given entity.
    `UriResourceEntitySet` | `parseEntityId(Edm edm, String entityId, String rawServiceRoot)` Parses a given entity-id.

- - ### Method Detail

    - #### buildContextURLSelectList

          String buildContextURLSelectList(EdmStructuredType type,
                                           ExpandOption expand,
                                           SelectOption select)
                                    throws SerializerException

      Builds the select-list part of a `ContextURL`.
      Parameters:
        `type` - the `EdmStructuredType`
        `expand` - the $expand option
        `select` - the $select option
      Returns:
        a String with the select list
      Throws:
        `SerializerException`

    - #### buildContextURLKeyPredicate

          String buildContextURLKeyPredicate(List<UriParameter> keys)
                                      throws SerializerException

      Builds the key-predicate part of a `ContextURL`.
      Parameters:
        `keys` - the keys as a list of `UriParameter` instances
      Returns:
        a String with the key predicate
      Throws:
        `SerializerException`

    - #### buildCanonicalURL

          String buildCanonicalURL(EdmEntitySet edmEntitySet,
                                   Entity entity)
                            throws SerializerException

      Builds the relative canonical URL for the given entity in the given entity set.
      Parameters:
        `edmEntitySet` - the entity set
        `entity` - the entity data
      Returns:
        the relative canonical URL
      Throws:
        `SerializerException`

    - #### buildKeyPredicate

          String buildKeyPredicate(EdmEntityType edmEntityType,
                                   Entity entity)
                            throws SerializerException

      Builds the key predicate for the given entity.
      Parameters:
        `edmEntityType` - the entity type of the entity
        `entity` - the entity data
      Returns:
        the key predicate
      Throws:
        `SerializerException`

    - #### parseEntityId

          UriResourceEntitySet parseEntityId(Edm edm,
                                             String entityId,
                                             String rawServiceRoot)
                                      throws DeserializerException

      Parses a given entity-id. Provides the entity set and key predicates. A canonical entiy-id to an entity must follow the pattern `[<service root>][<entityContainer>.]<entitySet>(<key>)`, i.e., it must be a relative or absolute URI consisting of an entity set (qualified with an entity-container name if not in the default entity container) and a syntactically valid key that identifies a single entity; example: `http://example.server.com/service.svc/Employees('42')`.
      Parameters:
        `edm` - the edm the entity belongs to
        `entityId` - URI of the entity-id
        `rawServiceRoot` - the root URI of the service
      Returns:
        `UriResourceEntitySet` - contains the entity set and the key predicates
      Throws:
        `DeserializerException` - in case the entity-id is malformed

Copyright © 2013–2022 The Apache Software Foundation. All rights reserved.