Package org.eclipse.emf.cdo.common.revision

# Interface CDORevisionData

All Known Subinterfaces:
  `InternalCDORevision`

All Known Implementing Classes:
  `AbstractCDORevision`, `BaseCDORevision`, `DelegatingCDORevision`, `DetachedCDORevision`, `PointerCDORevision`, `StubCDORevision`, `SyntheticCDORevision`

public interface CDORevisionData
Encapsulates the modeled information and the EMF system values of a `revision`.

Author:
  Eike Stepper
No Implement
  This interface is not intended to be implemented by clients.
No Extend
  This interface is not intended to be extended by clients.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final Object`
`NIL`
An object used to represent being set to `null` as opposed to having no value and hence being in the default state.

## Method Summary

Modifier and Type
Method
Description
`void`
`accept(CDORevisionValueVisitor visitor)`
`void`
`accept(CDORevisionValueVisitor visitor, Predicate<EStructuralFeature> filter)`
`void`
`accept(CDORevisionValueVisitor visitor, org.eclipse.net4j.util.Predicate<EStructuralFeature> filter)`
Deprecated.
As of 4.9 use `accept(CDORevisionValueVisitor, java.util.function.Predicate)`.
`default int`
`calculateContainerReferenceID(EReference containingReference)`
`static int`
`calculateContainerReferenceID(EReference containingReference, EClass childClass)`
`static EReference`
`calculateContainingReference(int containerFeatureID, EClass childClass, EClass containerClass)`
Provides the input to the calculation of the feature in the container revision that actually holds this revision.
`default int`
`calculateContainingReferenceID(EReference containingReference)`
Deprecated.
As of 4.27 use `calculateContainerReferenceID(EReference)`.
`static int`
`calculateContainingReferenceID(EReference containingReference, EClass childClass)`
Deprecated.
As of 4.27 use `calculateContainerReferenceID(EReference, EClass)`.
`boolean`
`contains(EStructuralFeature feature, Object value)`
`Object`
`get(EStructuralFeature feature, int index)`
`int`
`getContainerFeatureID()`
Returns the container feature ID.
`Object`
`getContainerID()`
`int`
`getContainingFeatureID()`
Deprecated.
As of 4.27 use `getContainerFeatureID()`.
`default EReference`
`getContainingReference(EClass containerClass)`
`CDOList`
`getListOrNull(EStructuralFeature feature)`
`CDOID`
`getResourceID()`
`Object`
`getValue(EStructuralFeature feature)`
Should never return `NIL`
`int`
`hashCode(EStructuralFeature feature)`
`int`
`indexOf(EStructuralFeature feature, Object value)`
`boolean`
`isEmpty(EStructuralFeature feature)`
`int`
`lastIndexOf(EStructuralFeature feature, Object value)`
`CDORevision`
`revision()`
`int`
`size(EStructuralFeature feature)`
`Object[]`
`toArray(EStructuralFeature feature)`
`<T> T[]`
`toArray(EStructuralFeature feature, T[] array)`

## Field Details

### NIL

static final Object NIL
An object used to represent being set to `null` as opposed to having no value and hence being in the default state.

The equivalent of `DynamicValueHolder.NIL` (i.e. explicit `null`).

Since:
  3.0

## Method Details

### revision

CDORevision revision()

Since:
  2.0

### getResourceID

CDOID getResourceID()

### getContainerID

Object getContainerID()

Since:
  2.0

### getContainerFeatureID

int getContainerFeatureID()
Returns the container feature ID. If the container isn't a navigable feature, this will be a negative ID indicating the inverse of the containment feature's ID.

Provides the input to the calculation of the feature in the container revision that actually holds this revision.

Usage Example:

     CDORevision revision = ...;
     CDORevision container = Util.getRevision(revision.data().getContainerID());

     int containerFeatureID = revision.data().getContainerFeatureID();

     EStructuralFeature feature = containerFeatureID <= InternalEObject.EOPPOSITE_FEATURE_BASE ?
         container.getEClass().getEStructuralFeature(InternalEObject.EOPPOSITE_FEATURE_BASE - containerFeatureID) :
         ((EReference)revision.getEClass().getEStructuralFeature(containerFeatureID)).getEOpposite();

Returns:
  the container feature ID.
Since:
  4.27
See Also:
  - `EObject.eContainmentFeature()`
  - `BasicEObjectImpl.eContainingFeature()`
  - `DelegatingEcoreEList.inverseAdd(Object, NotificationChain)`
  - `InternalEObject.EOPPOSITE_FEATURE_BASE`
  - `calculateContainingReference(int, EClass, EClass)`
  - `getContainerID()`

### getContainingReference

default EReference getContainingReference(EClass containerClass)

Since:
  4.26
See Also:
  - `getContainerFeatureID()`
  - `DelegatingEcoreEList.inverseAdd(Object, NotificationChain)`

### getValue

Object getValue(EStructuralFeature feature)
Should never return `NIL`

Since:
  4.27

### getListOrNull

CDOList getListOrNull(EStructuralFeature feature)

Since:
  4.27

### get

Object get(EStructuralFeature feature, int index)

Since:
  2.0

### size

int size(EStructuralFeature feature)

Since:
  2.0

### isEmpty

boolean isEmpty(EStructuralFeature feature)

Since:
  2.0

### contains

boolean contains(EStructuralFeature feature, Object value)

Since:
  2.0

### indexOf

int indexOf(EStructuralFeature feature, Object value)

Since:
  2.0

### lastIndexOf

int lastIndexOf(EStructuralFeature feature, Object value)

Since:
  2.0

### toArray

<T> T[] toArray(EStructuralFeature feature, T[] array)

Since:
  2.0

### toArray

Object[] toArray(EStructuralFeature feature)

Since:
  2.0

### hashCode

int hashCode(EStructuralFeature feature)

Since:
  2.0

### accept

void accept(CDORevisionValueVisitor visitor)

Since:
  4.2

### accept

void accept(CDORevisionValueVisitor visitor, Predicate<EStructuralFeature> filter)

Since:
  4.9

### calculateContainerReferenceID

default int calculateContainerReferenceID(EReference containingReference)

Since:
  4.27
See Also:
  - `DelegatingEcoreEList.inverseAdd(Object, NotificationChain)`

### calculateContainerReferenceID

static int calculateContainerReferenceID(EReference containingReference, EClass childClass)

Since:
  4.27
See Also:
  - `getContainerFeatureID()`
  - `DelegatingEcoreEList.inverseAdd(Object, NotificationChain)`

### calculateContainingReference

static EReference calculateContainingReference(int containerFeatureID, EClass childClass, EClass containerClass)
Provides the input to the calculation of the feature in the container revision that actually holds this revision.

Usage Example:

     CDORevision revision = ...;
     CDORevision container = Util.getRevision(revision.data().getContainerID());

     int containerFeatureID = revision.data().getContainerFeatureID();

     EStructuralFeature feature = containerFeatureID <= InternalEObject.EOPPOSITE_FEATURE_BASE ?
         container.getEClass().getEStructuralFeature(InternalEObject.EOPPOSITE_FEATURE_BASE - containerFeatureID) :
         ((EReference)revision.getEClass().getEStructuralFeature(containerFeatureID)).getEOpposite();

Since:
  4.26
See Also:
  - `getContainerFeatureID()`
  - `DelegatingEcoreEList.inverseAdd(Object, NotificationChain)`

### accept

@Deprecated void accept(CDORevisionValueVisitor visitor, org.eclipse.net4j.util.Predicate<EStructuralFeature> filter)
Deprecated.
As of 4.9 use `accept(CDORevisionValueVisitor, java.util.function.Predicate)`.

Since:
  4.2

### getContainingFeatureID

@Deprecated int getContainingFeatureID()
Deprecated.
As of 4.27 use `getContainerFeatureID()`.

### calculateContainingReferenceID

@Deprecated default int calculateContainingReferenceID(EReference containingReference)
Deprecated.
As of 4.27 use `calculateContainerReferenceID(EReference)`.

Since:
  4.26

### calculateContainingReferenceID

@Deprecated static int calculateContainingReferenceID(EReference containingReference, EClass childClass)
Deprecated.
As of 4.27 use `calculateContainerReferenceID(EReference, EClass)`.

Since:
  4.26