Top Description Fields Constructors Methods
rx.internal.util

public final Enum ExceptionsUtils

extends Enum<ExceptionsUtils>
Class Inheritance
Imports
java.util.*, java.util.concurrent.atomic.AtomicReference, rx.exceptions.CompositeException

Utility methods for terminal atomics with Throwables.
Since
1.1.2

Field Summary

Modifier and TypeField and Description
private static final Throwable
TERMINATED

The single instance of a Throwable indicating a terminal state.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

true if successful, false if the target field contains the terminal Throwable.
addThrowable
(AtomicReference<Throwable>
the target field
field
,
Throwable
the error to add
error
)

Atomically sets or combines the error with the contents of the field, wrapping multiple errors into CompositeException if necessary.

public static boolean

Returns:

true if the given field holds the terminated Throwable instance
isTerminated
(AtomicReference<Throwable>
the target field
field
)

Checks if the given field holds the terminated Throwable instance.

public static boolean

Returns:

true if the value is the terminated Throwable instance
isTerminated
(Throwable
the error to check
error
)

Returns true if the value is the terminated Throwable instance.

public static Throwable

Returns:

the previous contents of the field before the swap, may be null
terminate
(AtomicReference<Throwable>
the target field
field
)

Atomically swaps in the terminal Throwable and returns the previous contents of the field

public static ExceptionsUtils
public static ExceptionsUtils[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

TERMINATEDback to summary
private static final Throwable TERMINATED

The single instance of a Throwable indicating a terminal state.

Constructor Detail

ExceptionsUtilsback to summary
private ExceptionsUtils()

Method Detail

addThrowableback to summary
public static boolean addThrowable(AtomicReference<Throwable> field, Throwable error)

Atomically sets or combines the error with the contents of the field, wrapping multiple errors into CompositeException if necessary.

Parameters
field:AtomicReference<Throwable>

the target field

error:Throwable

the error to add

Returns:boolean

true if successful, false if the target field contains the terminal Throwable.

isTerminatedback to summary
public static boolean isTerminated(AtomicReference<Throwable> field)

Checks if the given field holds the terminated Throwable instance.

Parameters
field:AtomicReference<Throwable>

the target field

Returns:boolean

true if the given field holds the terminated Throwable instance

isTerminatedback to summary
public static boolean isTerminated(Throwable error)

Returns true if the value is the terminated Throwable instance.

Parameters
error:Throwable

the error to check

Returns:boolean

true if the value is the terminated Throwable instance

terminateback to summary
public static Throwable terminate(AtomicReference<Throwable> field)

Atomically swaps in the terminal Throwable and returns the previous contents of the field

Parameters
field:AtomicReference<Throwable>

the target field

Returns:Throwable

the previous contents of the field before the swap, may be null

valueOfback to summary
public static ExceptionsUtils valueOf(String name)
valuesback to summary
public static ExceptionsUtils[] values()