org.apache.olingo.ext.proxy.context

## Class EntityContext

- java.lang.Object
- - org.apache.olingo.ext.proxy.context.EntityContext

- All Implemented Interfaces:
    Iterable<AttachedEntity>

      public class EntityContext
      extends Object
      implements Iterable<AttachedEntity>

  Entity context.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EntityContext()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addFurtherDeletes(URI uri)`
    `void` | `attach(EntityInvocationHandler entity)` Attaches an existing entity with status `ATTACHED`.
    `void` | `attach(EntityInvocationHandler entity, AttachedEntityStatus status)` Attaches an entity with specified status.
    `void` | `attach(EntityInvocationHandler entity, AttachedEntityStatus status, boolean force)` Attaches an entity with specified status.
    `void` | `attachNew(EntityInvocationHandler entity)` Attaches an entity with status `NEW`.
    `void` | `detach(EntityInvocationHandler entity)` Detaches entity.
    `void` | `detachAll()` Detaches all attached entities.
    `EntityInvocationHandler` | `getEntity(EntityUUID uuid)` Searches an entity with the specified key.
    `List<URI>` | `getFurtherDeletes()`
    `AttachedEntityStatus` | `getStatus(EntityInvocationHandler entity)` Gets entity status.
    `boolean` | `isAttached(EntityInvocationHandler entity)` Checks if an entity is already attached.
    `Iterator<AttachedEntity>` | `iterator()` Iterator.
    `void` | `setStatus(EntityInvocationHandler entity, AttachedEntityStatus status)` Changes attached entity status.

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

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

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

      `forEach, spliterator`

- - ### Constructor Detail

    - #### EntityContext

          public EntityContext()

  - ### Method Detail

    - #### attachNew

          public void attachNew(EntityInvocationHandler entity)

      Attaches an entity with status `NEW`.
      Use this method to attach a new created entity.
      Parameters:
        `entity` - entity to be attached.
      See Also:
        `AttachedEntityStatus`

    - #### attach

          public void attach(EntityInvocationHandler entity)

      Attaches an existing entity with status `ATTACHED`.
      Use this method to attach an existing entity.
      Parameters:
        `entity` - entity to be attached.
      See Also:
        `AttachedEntityStatus`

    - #### attach

          public void attach(EntityInvocationHandler entity,
                             AttachedEntityStatus status)

      Attaches an entity with specified status.
      Use this method to attach an existing entity.
      Parameters:
        `entity` - entity to be attached.
        `status` - status.
      See Also:
        `AttachedEntityStatus`

    - #### attach

          public void attach(EntityInvocationHandler entity,
                             AttachedEntityStatus status,
                             boolean force)

      Attaches an entity with specified status.
      Use this method to attach an existing entity.
      Parameters:
        `entity` - entity to be attached.
        `status` - status.
        `force` - force attach.

    - #### detach

          public void detach(EntityInvocationHandler entity)

      Detaches entity.
      Parameters:
        `entity` - entity to be detached.

    - #### detachAll

          public void detachAll()

      Detaches all attached entities.
      Use this method to clears the entity context.

    - #### getEntity

          public EntityInvocationHandler getEntity(EntityUUID uuid)

      Searches an entity with the specified key.
      Parameters:
        `uuid` - entity key.
      Returns:
        retrieved entity.

    - #### getStatus

          public AttachedEntityStatus getStatus(EntityInvocationHandler entity)

      Gets entity status.
      Parameters:
        `entity` - entity to be retrieved.
      Returns:
        attached entity status.

    - #### setStatus

          public void setStatus(EntityInvocationHandler entity,
                                AttachedEntityStatus status)

      Changes attached entity status.
      Parameters:
        `entity` - attached entity to be modified.
        `status` - new status.

    - #### isAttached

          public boolean isAttached(EntityInvocationHandler entity)

      Checks if an entity is already attached.
      Parameters:
        `entity` - entity.
      Returns:
        `true` if is attached; `false` otherwise.

    - #### iterator

          public Iterator<AttachedEntity> iterator()

      Iterator.
      Specified by:
        `iterator` in interface `Iterable<AttachedEntity>`
      Returns:
        attached entities iterator.

    - #### getFurtherDeletes

          public List<URI> getFurtherDeletes()

    - #### addFurtherDeletes

          public void addFurtherDeletes(URI uri)

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