Module riakc_flag

Encapsulates a flag data-type.

Behaviours: riakc_datatype.

Description

Encapsulates a flag data-type. Flags are boolean values that can be enabled or disabled. Like the other eventually-consistent types, the original fetched value is unmodified by enabling or disabling. Instead, the effective operation (enable or disable) is captured for later application in Riak. Note that it is possible to enable a flag that is already true and disable a flag that is already false. Flags are only available as values in maps.

Data Types

flag()

abstract datatype: flag()

flag_op()

flag_op() = enable | disable

Function Index

disable/1Disables the flag, setting its value to false.
enable/1Enables the flag, setting its value to true.
is_type/1Determines whether the passed term is a flag container.
new/0Creates a new, empty flag container type.
new/1Creates a new flag with the passed context.
new/2Creates a new flag with the specified value and context.
to_op/1Extracts an operation from the flag that can be encoded into an update request.
type/0Returns the symbolic name of this container.
value/1Extracts the original value of the flag.

Function Details

disable/1

disable(Flag::flag()) -> flag()

throws context_required

Disables the flag, setting its value to false.

enable/1

enable(Flag::flag()) -> flag()

Enables the flag, setting its value to true.

is_type/1

is_type(T::term()) -> boolean()

Determines whether the passed term is a flag container.

new/0

new() -> flag()

Creates a new, empty flag container type.

new/1

new(Context::riakc_datatype:context()) -> flag()

Creates a new flag with the passed context.

new/2

new(Value::boolean(), Context::riakc_datatype:context()) -> flag()

Creates a new flag with the specified value and context.

to_op/1

to_op(Flag::flag()) -> riakc_datatype:update(flag_op())

Extracts an operation from the flag that can be encoded into an update request.

type/0

type() -> atom()

Returns the symbolic name of this container.

value/1

value(Flag::flag()) -> boolean()

Extracts the original value of the flag. true is enabled, false is disabled.


Generated by EDoc, Dec 16 2016, 16:38:08.