CommonErlangObjects
Date: 2016-02-29

de.zib.scalaris

## Class CommonErlangObjects

- java.lang.Object
- - de.zib.scalaris.CommonErlangObjects

-     public final class CommonErlangObjects
      extends Object

  Contains some often used objects as static objects as static members in order to avoid re-creating them each time they are needed.
  Since:
    2.5
  Version:
    3.14
  Author:
    Nico Kruber, kruber@zib.de

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static OtpErlangAtom` | `abortAtom`
    `static OtpErlangAtom` | `addDelOnListAtom`
    `static OtpErlangAtom` | `addOnNrAtom`
    `static OtpErlangAtom` | `arrayAtom`
    `static OtpErlangTuple` | `commitTupleAtom`
    `static OtpErlangAtom` | `emptyListAtom`
    `static OtpErlangAtom` | `failAtom`
    `static OtpErlangAtom` | `falseAtom`
    `static OtpErlangAtom` | `keyChangedAtom`
    `static OtpErlangAtom` | `notAListAtom`
    `static OtpErlangAtom` | `notANumberAtom`
    `static OtpErlangAtom` | `notFoundAtom`
    `static OtpErlangAtom` | `nullAtom`
    `static OtpErlangAtom` | `okAtom`
    `static OtpErlangTuple` | `okTupleAtom`
    `static OtpErlangAtom` | `randomFromListAtom`
    `static OtpErlangAtom` | `readAtom`
    `static OtpErlangAtom` | `structAtom`
    `static OtpErlangAtom` | `sublistAtom`
    `static OtpErlangAtom` | `testAndSetAtom`
    `static OtpErlangAtom` | `timeoutAtom`
    `static OtpErlangAtom` | `trueAtom`
    `static OtpErlangAtom` | `writeAtom`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CommonErlangObjects()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `checkResult_failAbort(OtpErlangObject received_raw, boolean compressed)` Processes the `received_raw` term from erlang and if it is a `{fail, abort, KeyList}`, issues an `AbortException`.
    `static void` | `checkResult_failAbort(OtpErlangTuple received, boolean compressed)` Processes the `received_raw` term from erlang and if it is a `{fail, abort, KeyList}`, issues an `AbortException`.
    `static OtpErlangObject` | `decode(OtpErlangObject value)` Decodes the given Erlang object from a binary to the according `OtpErlangObject` the same way as `rdht_tx:decode_value/1`.
    `static OtpErlangObject` | `encode(OtpErlangObject value)` Encoded the given erlang object to a binary the same way as `rdht_tx:encode_value/1`.

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

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

- - ### Field Detail

    - #### readAtom

          public static final OtpErlangAtom readAtom

    - #### writeAtom

          public static final OtpErlangAtom writeAtom

    - #### addDelOnListAtom

          public static final OtpErlangAtom addDelOnListAtom

    - #### testAndSetAtom

          public static final OtpErlangAtom testAndSetAtom

    - #### addOnNrAtom

          public static final OtpErlangAtom addOnNrAtom

    - #### okAtom

          public static final OtpErlangAtom okAtom

    - #### failAtom

          public static final OtpErlangAtom failAtom

    - #### abortAtom

          public static final OtpErlangAtom abortAtom

    - #### timeoutAtom

          public static final OtpErlangAtom timeoutAtom

    - #### notFoundAtom

          public static final OtpErlangAtom notFoundAtom

    - #### keyChangedAtom

          public static final OtpErlangAtom keyChangedAtom

    - #### notAListAtom

          public static final OtpErlangAtom notAListAtom

    - #### notANumberAtom

          public static final OtpErlangAtom notANumberAtom

    - #### emptyListAtom

          public static final OtpErlangAtom emptyListAtom

    - #### okTupleAtom

          public static final OtpErlangTuple okTupleAtom

    - #### commitTupleAtom

          public static final OtpErlangTuple commitTupleAtom

    - #### sublistAtom

          public static final OtpErlangAtom sublistAtom

    - #### randomFromListAtom

          public static final OtpErlangAtom randomFromListAtom

    - #### structAtom

          public static final OtpErlangAtom structAtom

    - #### arrayAtom

          public static final OtpErlangAtom arrayAtom

    - #### trueAtom

          public static final OtpErlangAtom trueAtom

    - #### falseAtom

          public static final OtpErlangAtom falseAtom

    - #### nullAtom

          public static final OtpErlangAtom nullAtom

  - ### Constructor Detail

    - #### CommonErlangObjects

          public CommonErlangObjects()

  - ### Method Detail

    - #### encode

          public static OtpErlangObject encode(OtpErlangObject value)

      Encoded the given erlang object to a binary the same way as `rdht_tx:encode_value/1`.
      Parameters:
        `value` - the decoded value
      Returns:
        the encoded value

    - #### decode

          public static OtpErlangObject decode(OtpErlangObject value)
                                        throws OtpErlangDecodeException

      Decodes the given Erlang object from a binary to the according `OtpErlangObject` the same way as `rdht_tx:decode_value/1`.
      Parameters:
        `value` - the encoded value
      Returns:
        the decoded value
      Throws:
        `OtpErlangDecodeException` - if decoding fails

    - #### checkResult_failAbort

          public static final void checkResult_failAbort(OtpErlangObject received_raw,
                                   boolean compressed)
                                                  throws AbortException,
                                                         UnknownException

      Processes the `received_raw` term from erlang and if it is a `{fail, abort, KeyList}`, issues an `AbortException`. NOTE: this method should not be called manually by an application and may change without prior notice!
      Parameters:
        `received_raw` - the object to process
        `compressed` - whether the transfer of values is compressed or not
      Throws:
        `AbortException` - if the commit of the write failed
        `UnknownException` - if any other error occurs
      Since:
        3.8

    - #### checkResult_failAbort

          public static final void checkResult_failAbort(OtpErlangTuple received,
                                   boolean compressed)
                                                  throws AbortException,
                                                         UnknownException

      Processes the `received_raw` term from erlang and if it is a `{fail, abort, KeyList}`, issues an `AbortException`. NOTE: this method should not be called manually by an application and may change without prior notice!
      Parameters:
        `received` - the object to process
        `compressed` - whether the transfer of values is compressed or not
      Throws:
        `AbortException` - if the commit of the write failed
        `UnknownException` - if any other error occurs
      Since:
        3.12