RichReadAttributeValue

meteor.syntax.RichReadAttributeValue
implicit class RichReadAttributeValue(av: AttributeValue)

Provide extension method(s) to read from a Java AttributeValue

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def as[A : Decoder]: Either[DecoderError, A]

Attempt to read the AttributeValue as a value of type A or DecoderError

Attempt to read the AttributeValue as a value of type A or DecoderError

Note: if the value of the AttributeValue is nullable, use asOpt instead.

Attributes

Returns

either a value of type A or DecoderError

def asOpt[A : Decoder]: Either[DecoderError, Option[A]]

Attempt to read the AttributeValue as an optional value of type A or DecoderError. This should be used when AttributeValue can be NULL.

Attempt to read the AttributeValue as an optional value of type A or DecoderError. This should be used when AttributeValue can be NULL.

Attributes

Returns

either an optional value of type A or DecoderError

def get(key: String): Either[DecoderError, AttributeValue]

Attempt to treat the AttributeValue as of type M, retrieve value by a given key as an AttributeValue.

Attempt to treat the AttributeValue as of type M, retrieve value by a given key as an AttributeValue.

Value parameters

key

the key whose associated value is to be returned

Attributes

Returns

either a value as AttributeValue type or DecoderError

def getAs[A : Decoder](key: String): Either[DecoderError, A]

Attempt to treat the AttributeValue as of type M, retrieve AttributeValue that associated to a given key and attempt reading it to a value of type A.

Attempt to treat the AttributeValue as of type M, retrieve AttributeValue that associated to a given key and attempt reading it to a value of type A.

Note: if the returning AttributeValue is nullable, use getOpt instead.

Value parameters

key

the key whose associated value is to be returned

Attributes

Returns

either a value of type A type or DecoderError

def getOpt[A : Decoder](key: String): Either[DecoderError, Option[A]]

Attempt to treat the AttributeValue as of type M, retrieve AttributeValue that associated to a given key and attempt reading it to an optional value of type A. This should be used when the returning AttributeValue can be NULL.

Attempt to treat the AttributeValue as of type M, retrieve AttributeValue that associated to a given key and attempt reading it to an optional value of type A. This should be used when the returning AttributeValue can be NULL.

Value parameters

key

the key whose associated value is to be returned

Attributes

Returns

either a value of type A type or DecoderError