Package com.orchestranetworks.instance

# Class DefinitionMode

java.lang.Object
com.orchestranetworks.instance.DefinitionMode

public final class DefinitionMode extends Object
Defines the possible inheritance modes for a record.

See Also:
  - `Adaptation.getParent()`
  - `Adaptation.getOccurrenceDefinitionMode()`
  - Dataset inheritance

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final DefinitionMode`
  `DEFINE_OCCULT`
  The record is in occulting mode to specify that the record with the same primary key is not inherited from the parent dataset.
  `static final DefinitionMode`
  `DEFINE_OVERWRITE`
  The record is in overwriting mode when it is locally defined in the current table and it has a parent record with the same primary key.
  `static final DefinitionMode`
  `DEFINE_ROOT`
  A record is in root mode when it is locally defined in the current table and it does not inherit from a parent record.
  `static final DefinitionMode`
  `INHERIT`
  A record is in inherit mode when it is not defined in the current table.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `format()`
  Returns a persistent identifier for this definition mode.
  `String`
  `getLabel()`
  Returns a human-readable label for this definition mode.
  `boolean`
  `isInherit()`
  Returns `true` if this is the `INHERIT` state.
  `boolean`
  `isOcculting()`
  Returns `true` if this is the `DEFINE_OCCULT` state.
  `boolean`
  `isOverwriting()`
  Returns `true` if this is the `DEFINE_OVERWRITE` state.
  `boolean`
  `isRoot()`
  Returns `true` if this is the `DEFINE_ROOT` state.
  `static DefinitionMode`
  `parse(String aFlag)`
  Returns the definition mode that corresponds to the specified string.
  `String`
  `toString()`

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

  `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### INHERIT

    public static final DefinitionMode INHERIT
    A record is in inherit mode when it is not defined in the current table. This implies that it inherits all its values from a parent record defined in an ancestor table.

  - ### DEFINE_ROOT

    public static final DefinitionMode DEFINE_ROOT
    A record is in root mode when it is locally defined in the current table and it does not inherit from a parent record.

  - ### DEFINE_OVERWRITE

    public static final DefinitionMode DEFINE_OVERWRITE
    The record is in overwriting mode when it is locally defined in the current table and it has a parent record with the same primary key.

    The record then inherits its unspecified values from its parent record.

  - ### DEFINE_OCCULT

    public static final DefinitionMode DEFINE_OCCULT
    The record is in occulting mode to specify that the record with the same primary key is not inherited from the parent dataset. This implies that the resolved view of the table does not contain this record.

    If a record in occulting mode is deleted, it becomes inherited if a record with the same primary key exists in the parent dataset (either root, overwriting or itself inherited).

- ## Method Details

  - ### isInherit

    public boolean isInherit()
    Returns `true` if this is the `INHERIT` state.

  - ### isRoot

    public boolean isRoot()
    Returns `true` if this is the `DEFINE_ROOT` state.

  - ### isOverwriting

    public boolean isOverwriting()
    Returns `true` if this is the `DEFINE_OVERWRITE` state.

  - ### isOcculting

    public boolean isOcculting()
    Returns `true` if this is the `DEFINE_OCCULT` state.

  - ### format

    public String format()
    Returns a persistent identifier for this definition mode.

    The persistent identifier can be re-obtained by parsing using the method `parse(String)`.

    See Also:
      - `parse(String)`

  - ### parse

    public static DefinitionMode parse(String aFlag)
    Returns the definition mode that corresponds to the specified string.

    The specified string must have been generated by the method `format()`.

    Throws:
      `IllegalArgumentException` - if string specified is incorrect.
    See Also:
      - `format()`

  - ### getLabel

    public String getLabel()
    Returns a human-readable label for this definition mode.

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`