org.apache.olingo.ext.proxy.commons

## Class EntitySetInvocationHandler<T extends EntityType<?>,KEY extends Serializable,EC extends EntityCollection<T,?,?>>

- java.lang.Object
- - org.apache.olingo.ext.proxy.commons.AbstractCollectionInvocationHandler<T,EC>
  - - org.apache.olingo.ext.proxy.commons.AbstractEntityCollectionInvocationHandler<T,EC>
    - - org.apache.olingo.ext.proxy.commons.EntitySetInvocationHandler<T,KEY,EC>

- All Implemented Interfaces:
    Serializable, Iterable<T>, InvocationHandler, Collection<T>, AbstractEntitySet<T,KEY,EC>

      public class EntitySetInvocationHandler<T extends EntityType<?>,KEY extends Serializable,EC extends EntityCollection<T,?,?>>
      extends AbstractEntityCollectionInvocationHandler<T,EC>
      implements AbstractEntitySet<T,KEY,EC>

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static org.slf4j.Logger` | `LOG` Logger.
    `protected AbstractService<?>` | `service`

    - ### Fields inherited from class org.apache.olingo.ext.proxy.commons.AbstractEntityCollectionInvocationHandler

      `collItemRef, targetEntitySetURI`

    - ### Fields inherited from class org.apache.olingo.ext.proxy.commons.AbstractCollectionInvocationHandler

      `annotations, baseURI, itemRef, items, nextPageURI, referenceItems, uri`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `EntitySetInvocationHandler(Class<?> ref, AbstractService<?> service, URIBuilder uri)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static URIBuilder` | `buildEntitySetURI(Class<?> ref, AbstractService<?> service)`
    `protected static URIBuilder` | `buildEntitySetURI(String entitySetName, AbstractService<?> service)`
    `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.
    `protected <S extends EntityType<?>> void` | `deleteEntity(EntityInvocationHandler handler, URI entitySetURI)`
    `boolean` | `equals(Object obj)`
    `EC` | `execute()`
    `<S extends T,SEC extends EntityCollection<S,?,?>> SEC` | `execute(Class<SEC> collTypeRef)`
    `<S extends T,SEC extends EntityCollection<S,?,?>> Future<SEC>` | `executeAsync(Class<SEC> collTypeRef)`
    `Boolean` | `exists(KEY key)` Returns whether an entity with the given id exists.
    `<S extends T,SEC extends EntityCollection<S,?,?>> SEC` | `fetchWholeEntitySet(URIBuilder uriBuilder, Class<S> typeRef, Class<SEC> collTypeRef)`
    `T` | `getByKey(KEY key)` Retrieves an entity by its key.
    `<S extends T> S` | `getByKey(KEY key, Class<S> typeRef)` Retrieves an entity by its key, considering polymorphism.
    `protected EdmEnabledODataClient` | `getClient()`
    `protected ComplexType<?>` | `getComplex(String name, ClientValue value, Class<?> ref, EntityInvocationHandler handler, URI baseURI, boolean collectionItem)`
    `protected Context` | `getContext()`
    `static EntitySetInvocationHandler` | `getInstance(Class<?> ref, AbstractService<?> service)`
    `static EntitySetInvocationHandler` | `getInstance(Class<?> ref, AbstractService<?> service, URI uri)`
    `int` | `hashCode()`
    `Object` | `invoke(Object proxy, Method method, Object[] args)`
    `protected Object` | `invokeSelfMethod(Method method, Object[] args)`
    `protected boolean` | `isDeleted(EntityInvocationHandler handler)`
    `protected boolean` | `isSelfMethod(Method method)`
    `org.apache.olingo.ext.proxy.commons.EntitySetIterator<T,KEY,EC>` | `iterator()`
    `String` | `toString()`

    - ### Methods inherited from class org.apache.olingo.ext.proxy.commons.AbstractEntityCollectionInvocationHandler

      `fetchPartial`

    - ### Methods inherited from class org.apache.olingo.ext.proxy.commons.AbstractCollectionInvocationHandler

      `add, addAll, addRef, clear, clearQueryOptions, contains, containsAll, executeAsync, expand, filter, filter, getAnnotation, getAnnotationTerms, getRequestURI, getTypeRef, getURI, hasNextPage, isEmpty, nextPage, orderBy, orderBy, refs, remove, removeAll, retainAll, select, setAnnotations, size, skip, toArray, toArray, top`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.olingo.ext.proxy.api.AbstractEntitySet

      `add`

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

      `forEach, spliterator`

    - ### Methods inherited from interface java.util.Collection

      `equals, hashCode, parallelStream, removeIf, spliterator, stream`

- - ### Field Detail

    - #### LOG

          protected static final org.slf4j.Logger LOG

      Logger.

    - #### service

          protected AbstractService<?> service

  - ### Constructor Detail

    - #### EntitySetInvocationHandler

          protected EntitySetInvocationHandler(Class<?> ref,
                                               AbstractService<?> service,
                                               URIBuilder uri)

  - ### Method Detail

    - #### getInstance

          public static EntitySetInvocationHandler getInstance(Class<?> ref,
                                                               AbstractService<?> service)

    - #### getInstance

          public static EntitySetInvocationHandler getInstance(Class<?> ref,
                                                               AbstractService<?> service,
                                                               URI uri)

    - #### invoke

          public Object invoke(Object proxy,
                               Method method,
                               Object[] args)
                        throws Throwable

      Specified by:
        `invoke` in interface `InvocationHandler`
      Throws:
        `Throwable`

    - #### count

          public Long count()

      Description copied from interface: `AbstractEntitySet`
      Returns the number of entities available.
      Specified by:
        `count` in interface `AbstractEntitySet<T extends EntityType<?>,KEY extends Serializable,EC extends EntityCollection<T,?,?>>`
      Returns:
        the number of entities

    - #### exists

          public Boolean exists(KEY key)
                         throws IllegalArgumentException

      Description copied from interface: `AbstractEntitySet`
      Returns whether an entity with the given id exists.
      Specified by:
        `exists` in interface `AbstractEntitySet<T extends EntityType<?>,KEY extends Serializable,EC extends EntityCollection<T,?,?>>`
      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

          public T getByKey(KEY key)
                     throws IllegalArgumentException

      Description copied from interface: `AbstractEntitySet`
      Retrieves an entity by its key.
      Specified by:
        `getByKey` in interface `AbstractEntitySet<T extends EntityType<?>,KEY extends Serializable,EC extends EntityCollection<T,?,?>>`
      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

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

      Description copied from interface: `AbstractEntitySet`
      Retrieves an entity by its key, considering polymorphism.
      Specified by:
        `getByKey` in interface `AbstractEntitySet<T extends EntityType<?>,KEY extends Serializable,EC extends EntityCollection<T,?,?>>`
      Parameters:
        `key` - must not be null
        `typeRef` - 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

    - #### execute

          public EC execute()

      Overrides:
        `execute` in class `AbstractCollectionInvocationHandler<T extends EntityType<?>,EC extends EntityCollection<T,?,?>>`

    - #### executeAsync

          public <S extends T,SEC extends EntityCollection<S,?,?>> Future<SEC> executeAsync(Class<SEC> collTypeRef)

    - #### execute

          public <S extends T,SEC extends EntityCollection<S,?,?>> SEC execute(Class<SEC> collTypeRef)

    - #### createSearch

          public Search<T,EC> createSearch()

      Description copied from interface: `AbstractEntitySet`
      Create an instance of `Search`.
      Specified by:
        `createSearch` in interface `AbstractEntitySet<T extends EntityType<?>,KEY extends Serializable,EC extends EntityCollection<T,?,?>>`
      Returns:
        the new search instance

    - #### createSearch

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

      Description copied from interface: `AbstractEntitySet`
      Create an instance of `Search`.
      Specified by:
        `createSearch` in interface `AbstractEntitySet<T extends EntityType<?>,KEY extends Serializable,EC extends EntityCollection<T,?,?>>`
      Returns:
        the new search instance

    - #### fetchWholeEntitySet

          public <S extends T,SEC extends EntityCollection<S,?,?>> SEC fetchWholeEntitySet(URIBuilder uriBuilder,
                                                                                           Class<S> typeRef,
                                                                                           Class<SEC> collTypeRef)

    - #### delete

          public void delete(KEY key)
                      throws IllegalArgumentException

      Description copied from interface: `AbstractEntitySet`
      Deletes the entity with the given key.
      Specified by:
        `delete` in interface `AbstractEntitySet<T extends EntityType<?>,KEY extends Serializable,EC extends EntityCollection<T,?,?>>`
      Parameters:
        `key` - must not be null
      Throws:
        `IllegalArgumentException` - in case the given key is null

    - #### delete

          public <S extends T> void delete(S entity)

      Description copied from interface: `AbstractEntitySet`
      Deletes the given entity in a batch.
      Specified by:
        `delete` in interface `AbstractEntitySet<T extends EntityType<?>,KEY extends Serializable,EC extends EntityCollection<T,?,?>>`
      Parameters:
        `entity` - to be deleted

    - #### delete

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

      Description copied from interface: `AbstractEntitySet`
      Deletes the given entities in a batch.
      Specified by:
        `delete` in interface `AbstractEntitySet<T extends EntityType<?>,KEY extends Serializable,EC extends EntityCollection<T,?,?>>`
      Parameters:
        `entities` - to be deleted

    - #### iterator

          public org.apache.olingo.ext.proxy.commons.EntitySetIterator<T,KEY,EC> iterator()

      Specified by:
        `iterator` in interface `Iterable<T extends EntityType<?>>`
      Specified by:
        `iterator` in interface `Collection<T extends EntityType<?>>`
      Overrides:
        `iterator` in class `AbstractCollectionInvocationHandler<T extends EntityType<?>,EC extends EntityCollection<T,?,?>>`

    - #### getClient

          protected EdmEnabledODataClient getClient()

    - #### getContext

          protected Context getContext()

    - #### isSelfMethod

          protected boolean isSelfMethod(Method method)

    - #### invokeSelfMethod

          protected Object invokeSelfMethod(Method method,
                                            Object[] args)
                                     throws Throwable

      Throws:
        `Throwable`

    - #### getComplex

          protected ComplexType<?> getComplex(String name,
                                              ClientValue value,
                                              Class<?> ref,
                                              EntityInvocationHandler handler,
                                              URI baseURI,
                                              boolean collectionItem)

    - #### isDeleted

          protected boolean isDeleted(EntityInvocationHandler handler)

    - #### deleteEntity

          protected <S extends EntityType<?>> void deleteEntity(EntityInvocationHandler handler,
                                                                URI entitySetURI)

    - #### buildEntitySetURI

          protected static URIBuilder buildEntitySetURI(Class<?> ref,
                                                        AbstractService<?> service)

    - #### buildEntitySetURI

          protected static URIBuilder buildEntitySetURI(String entitySetName,
                                                        AbstractService<?> service)

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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