Summary: Methods | Inherited Methods | [Expand All]

# Atoms

`public final class Atoms`
`extends Object` ``

java.lang.Object
↳ | android.support.test.espresso.web.model.Atoms

Utility class wrapping simple and more commonly used atoms.

## Summary

### Public methods
`static <E> Transformer<Evaluation, E>` | `castOrDie(Class<E> clazz)` Creates a transformer which will convert an Evaluation to a given type (or die trying).
`static Atom<String>` | `getCurrentUrl()` Returns the value of document.location.href.
`static Atom<String>` | `getTitle()` Returns the value of document.title.
`static Atom<Evaluation>` | `script(String script)` Creates an atom that will execute the provided script and return an evaluation object.
`static <O> Atom<O>` | `script(String script, Transformer<Evaluation, O> transformer)` Creates an atom that will execute the provided script and return an object created by the given transformer.
`static Atom<Evaluation>` | `scriptWithArgs(String script, List<? extends Object> args)` Creates an atom that will execute the provided script with the given non-contextual arguments.
`static <I, O> Atom<O>` | `transform(Atom<I> in, Transformer<I, O> transformer)` Creates an atom which wraps the input atom and transforms its output using the given transformer.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()`
`boolean` | `equals(Object arg0)`
`void` | `finalize()`
`final Class<?>` | `getClass()`
`int` | `hashCode()`
`final void` | `notify()`
`final void` | `notifyAll()`
`String` | `toString()`
`final void` | `wait(long arg0, int arg1)`
`final void` | `wait(long arg0)`
`final void` | `wait()`

## Public methods

### castOrDie

    Transformer<Evaluation, E> castOrDie (Class<E> clazz)

Creates a transformer which will convert an Evaluation to a given type (or die trying).

Parameters
`clazz` | `Class`

Returns
`Transformer<Evaluation, E>` |

### getCurrentUrl

    Atom<String> getCurrentUrl ()

Returns the value of document.location.href.

Returns
`Atom<String>` |

### getTitle

    Atom<String> getTitle ()

Returns the value of document.title.

Returns
`Atom<String>` |

### script

    Atom<Evaluation> script (String script)

Creates an atom that will execute the provided script and return an evaluation object.

Parameters
`script` | `String`

Returns
`Atom<Evaluation>` |

### script

    Atom<O> script (String script,
                    Transformer<Evaluation, O> transformer)

Creates an atom that will execute the provided script and return an object created by the given transformer.

Parameters
`script` | `String`
`transformer` | `Transformer`

Returns
`Atom<O>` |

### scriptWithArgs

    Atom<Evaluation> scriptWithArgs (String script,
                    List<? extends Object> args)

Creates an atom that will execute the provided script with the given non-contextual arguments.

Parameters
`script` | `String`
`args` | `List`

Returns
`Atom<Evaluation>` |

### transform

    Atom<O> transform (Atom<I> in,
                    Transformer<I, O> transformer)

Creates an atom which wraps the input atom and transforms its output using the given transformer.

Parameters
`in` | `Atom`
`transformer` | `Transformer`

Returns
`Atom<O>` |

- ## Interfaces

  - Atom
  - JSONAble
  - JSONAble.DeJSONFactory
  - TransformingAtom.Transformer

- ## Classes

  - Atoms
  - ElementReference
  - Evaluation
  - ModelCodec
  - SimpleAtom
  - TransformingAtom
  - WindowReference

- ## Enums

  - SimpleAtom.ElementReferencePlacement