org.apache.olingo.ext.proxy.api

## Interface AbstractEntitySet<T extends EntityType<?>,KEY extends Serializable,EC extends Collection<T>>

- All Superinterfaces:
    Iterable<T>, Serializable
  All Known Implementing Classes:
    EntitySetInvocationHandler, InlineEntitySetInvocationHandler

      public interface AbstractEntitySet<T extends EntityType<?>,KEY extends Serializable,EC extends Collection<T>>
      extends Iterable<T>, Serializable

  Interface for synchronous CRUD operations on an EntitySet.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `add(T entity)`
    `Long` | `count()` Returns the number of entities available.
    `Search<T,EC>` | `createSearch()` Create an instance of `Search`.
    `<S extends T,SEC extends EntityCollection<S,?,?>> Search<S,SEC>` | `createSearch(Class<SEC> reference)` Create an instance of `Search`.
    `<S extends T> void` | `delete(Iterable<S> entities)` Deletes the given entities in a batch.
    `void` | `delete(KEY key)` Deletes the entity with the given key.
    `<S extends T> void` | `delete(S entity)` Deletes the given entity in a batch.
    `Boolean` | `exists(KEY key)` Returns whether an entity with the given id exists.
    `T` | `getByKey(KEY key)` Retrieves an entity by its key.
    `<S extends T> S` | `getByKey(KEY key, Class<S> reference)` Retrieves an entity by its key, considering polymorphism.

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, iterator, spliterator`

- - ### Method Detail

    - #### add

          boolean add(T entity)

    - #### exists

          Boolean exists(KEY key)
                  throws IllegalArgumentException

      Returns whether an entity with the given id exists.
      Parameters:
        `key` - must not be null
      Returns:
        true if an entity with the given id exists, false otherwise
      Throws:
        `IllegalArgumentException` - in case the given key is null

    - #### getByKey

          T getByKey(KEY key)
              throws IllegalArgumentException

      Retrieves an entity by its key.
      Parameters:
        `key` - must not be null
      Returns:
        the entity with the given id or null if none found
      Throws:
        `IllegalArgumentException` - in case the given key is null

    - #### getByKey

          <S extends T> S getByKey(KEY key,
                                   Class<S> reference)
                            throws IllegalArgumentException

      Retrieves an entity by its key, considering polymorphism.
      Type Parameters:
        `S` -
      Parameters:
        `key` - must not be null
        `reference` - entity class to be returned
      Returns:
        the entity with the given id or null if none found
      Throws:
        `IllegalArgumentException` - in case the given key is null

    - #### count

          Long count()

      Returns the number of entities available.
      Returns:
        the number of entities

    - #### delete

          void delete(KEY key)
               throws IllegalArgumentException

      Deletes the entity with the given key.
      Parameters:
        `key` - must not be null
      Throws:
        `IllegalArgumentException` - in case the given key is null

    - #### delete

          <S extends T> void delete(S entity)

      Deletes the given entity in a batch.
      Type Parameters:
        `S` -
      Parameters:
        `entity` - to be deleted

    - #### delete

          <S extends T> void delete(Iterable<S> entities)

      Deletes the given entities in a batch.
      Type Parameters:
        `S` -
      Parameters:
        `entities` - to be deleted

    - #### createSearch

          Search<T,EC> createSearch()

      Create an instance of `Search`.
      Returns:
        the new search instance

    - #### createSearch

          <S extends T,SEC extends EntityCollection<S,?,?>> Search<S,SEC> createSearch(Class<SEC> reference)

      Create an instance of `Search`.
      Type Parameters:
        `S` -
        `SEC` -
      Parameters:
        `reference` -
      Returns:
        the new search instance

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