Top Description Interfaces Annotations
module io.vavr

Package io.vavr.control


Control structures like the disjoint union type io.vavr.control.Either, the optional value type io.vavr.control.Option and io.vavr.control.Try for exception handling.

Either

The control package contains an implementation of the io.vavr.control.Either control which is either Left or Right. A given Either is projected to a Left or a Right. Both cases can be further processed with control operations map, flatMap, filter. If a Right is projected to a Left, the Left control operations have no effect on the Right value. If a Left is projected to a Right, the Right control operations have no effect on the Left value.

Option

The Option control is a replacement for java.util.Optional. An Option is either io.vavr.control.Option.Some value or io.vavr.control.Option.None. In contrast to Optional, Option supports null values, i.e. it is possible to call new Some(null). However, Option.of(null) results in None.

Try

Exceptions are handled with the io.vavr.control.Try control which is either a io.vavr.control.Try.Success, containing a result, or a io.vavr.control.Try.Failure, containing an Exception.

Interface Summary

Modifier and TypeInterface and Description
public interface
Either<
The type of the Left value of an Either.
L
,
The type of the Right value of an Either.
R
>

Either represents a value of two possible types.

public interface
HashCodes

Deprecated Will be removed from public API
Utility that allows to compute hashcodes without var-arg conversion into arrays for common types of vavr.
public interface
Option<
The type of the optional value.
T
>

Replacement for java.util.Optional.

public interface
Try<
Value type in the case of success.
T
>

The Try control gives us the ability write safe code without focusing on try-catch blocks in the presence of exceptions.

pack-priv interface
public interface
Validation<
value type in the case of invalid
E
,
value type in the case of valid
T
>

An implementation similar to scalaz's Validation control.

Annotation Summary

Modifier and TypeAnnotation and Description
pack-priv @interface