object DynamoFormat extends EnumDynamoFormat with Serializable
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- DynamoFormat
- Serializable
- Serializable
- EnumDynamoFormat
- DerivedDynamoFormat
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Type Members
-
trait
CoProductDynamoFormat[T] extends DynamoFormat[T]
- Definition Classes
- DerivedDynamoFormat
-
trait
ConstructedDynamoFormat[T] extends AnyRef
- Definition Classes
- DerivedDynamoFormat
-
trait
InvalidConstructedDynamoFormat[T] extends ConstructedDynamoFormat[T]
- Definition Classes
- DerivedDynamoFormat
-
trait
ValidConstructedDynamoFormat[T] extends ConstructedDynamoFormat[T]
- Definition Classes
- DerivedDynamoFormat
- trait AllOps[T] extends Ops[T]
-
type
NotSymbol[T] = <:!<[T, Symbol]
- Definition Classes
- DerivedDynamoFormat
- trait Ops[T] extends AnyRef
- trait ToDynamoFormatOps extends AnyRef
-
type
ValidatedPropertiesError[T] = Validated[InvalidPropertiesError, T]
- Definition Classes
- DerivedDynamoFormat
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
implicit
val
BigDecimalSetFormat: DynamoFormat[Set[BigDecimal]]
prop> import com.amazonaws.services.dynamodbv2.model.AttributeValue prop> import org.scalacheck._ prop> implicit def arbNonEmptySet[T: Arbitrary] = Arbitrary(Gen.nonEmptyContainerOf[Set, T](Arbitrary.arbitrary[T])) prop> (s: Set[BigDecimal]) => | val av = new AttributeValue().withNS(s.toList.map(_.toString): _*) | DynamoFormat[Set[BigDecimal]].write(s) == av && | DynamoFormat[Set[BigDecimal]].read(av) == Right(s) >>> DynamoFormat[Set[BigDecimal]].write(Set.empty).getNULL true
-
def
apply[T](implicit instance: DynamoFormat[T]): DynamoFormat[T]
- Annotations
- @inline()
-
implicit
def
arrayFormat[T](implicit arg0: ClassTag[T], f: DynamoFormat[T]): DynamoFormat[Array[T]]
prop> (a: Array[String]) => | DynamoFormat[Array[String]].read(DynamoFormat[Array[String]].write(a)).right.getOrElse(Array("error")).deep == | a.deep
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
implicit
val
bigDecimalFormat: DynamoFormat[BigDecimal]
prop> (d: BigDecimal) => | DynamoFormat[BigDecimal].read(DynamoFormat[BigDecimal].write(d)) == Right(d) -
implicit
val
booleanFormat: DynamoFormat[Boolean]
prop> (b: Boolean) => | DynamoFormat[Boolean].read(DynamoFormat[Boolean].write(b)) == Right(b)
-
implicit
val
byteArrayFormat: DynamoFormat[Array[Byte]]
prop> (ab:Array[Byte]) => | DynamoFormat[Array[Byte]].read(DynamoFormat[Array[Byte]].write(ab)) == Right(ab)
-
implicit
val
byteFormat: DynamoFormat[Byte]
prop> (b: Byte) => | DynamoFormat[Byte].read(DynamoFormat[Byte].write(b)) == Right(b)
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
implicit
val
cnil: CoProductDynamoFormat[CNil]
- Definition Classes
- DerivedDynamoFormat
-
def
coercedXmap[A, B, T >: Null <: Throwable](read: (B) ⇒ A)(write: (A) ⇒ B)(implicit f: DynamoFormat[B], T: ClassTag[T], NT: NotNull[T]): DynamoFormat[A]
Returns a DynamoFormat for the case where
Acan always be convertedB, withwrite, butreadmay throw an exception for some value ofBReturns a DynamoFormat for the case where
Acan always be convertedB, withwrite, butreadmay throw an exception for some value ofB>>> import org.joda.time._ >>> val jodaStringFormat = DynamoFormat.coercedXmap[LocalDate, String, IllegalArgumentException]( ... LocalDate.parse ... )( ... _.toString ... ) >>> jodaStringFormat.read(jodaStringFormat.write(new LocalDate(2007, 8, 18))) Right(2007-08-18) >>> import com.amazonaws.services.dynamodbv2.model.AttributeValue >>> jodaStringFormat.read(new AttributeValue().withS("Togtogdenoggleplop")) Left(TypeCoercionError(java.lang.IllegalArgumentException: Invalid format: "Togtogdenoggleplop"))
-
implicit
def
coproduct[K <: Symbol, V, T <: Coproduct](implicit headFormat: Lazy[DynamoFormat[V]], tailFormat: CoProductDynamoFormat[T], fieldWitness: Aux[K]): CoProductDynamoFormat[:+:[FieldType[K, V], T]]
- Definition Classes
- DerivedDynamoFormat
-
implicit
val
doubleFormat: DynamoFormat[Double]
prop> (d: Double) => | DynamoFormat[Double].read(DynamoFormat[Double].write(d)) == Right(d)
-
implicit
val
doubleSetFormat: DynamoFormat[Set[Double]]
prop> import com.amazonaws.services.dynamodbv2.model.AttributeValue prop> import org.scalacheck._ prop> implicit def arbNonEmptySet[T: Arbitrary] = Arbitrary(Gen.nonEmptyContainerOf[Set, T](Arbitrary.arbitrary[T])) prop> (s: Set[Double]) => | val av = new AttributeValue().withNS(s.toList.map(_.toString): _*) | DynamoFormat[Set[Double]].write(s) == av && | DynamoFormat[Set[Double]].read(av) == Right(s) >>> DynamoFormat[Set[Double]].write(Set.empty).getNULL true
-
implicit
def
enumDynamoFormatCCons[K <: Symbol, V, R <: Coproduct](implicit fieldWitness: Aux[K], emptyGeneric: Aux[V, HNil], alternativeFormat: EnumerationDynamoFormat[R]): EnumerationDynamoFormat[:+:[FieldType[K, V], R]]
- Definition Classes
- EnumDynamoFormat
-
implicit
val
enumDynamoFormatCNil: EnumerationDynamoFormat[CNil]
- Definition Classes
- EnumDynamoFormat
-
implicit
def
enumFormat[A, Repr <: Coproduct](implicit gen: Aux[A, Repr], genericFormat: EnumerationDynamoFormat[Repr]): EnumerationDynamoFormat[A]
- Definition Classes
- EnumDynamoFormat
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
implicit
def
genericCoProduct[T, R](implicit gen: Aux[T, R], formatR: Lazy[CoProductDynamoFormat[R]]): DynamoFormat[T]
- Definition Classes
- DerivedDynamoFormat
-
implicit
def
genericProduct[T, R](implicit arg0: NotSymbol[T], gen: Aux[T, R], formatR: Lazy[ValidConstructedDynamoFormat[R]]): DynamoFormat[T]
- Definition Classes
- DerivedDynamoFormat
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
implicit
def
hcons[K <: Symbol, V, T <: HList](implicit headFormat: Lazy[DynamoFormat[V]], tailFormat: Lazy[ConstructedDynamoFormat[T]], fieldWitness: Aux[K]): ValidConstructedDynamoFormat[::[FieldType[K, V], T]]
- Definition Classes
- DerivedDynamoFormat
-
implicit
val
hnil: InvalidConstructedDynamoFormat[HNil]
- Definition Classes
- DerivedDynamoFormat
-
implicit
val
intFormat: DynamoFormat[Int]
prop> (i: Int) => | DynamoFormat[Int].read(DynamoFormat[Int].write(i)) == Right(i)
-
implicit
val
intSetFormat: DynamoFormat[Set[Int]]
prop> import com.amazonaws.services.dynamodbv2.model.AttributeValue prop> import org.scalacheck._ prop> implicit def arbNonEmptySet[T: Arbitrary] = Arbitrary(Gen.nonEmptyContainerOf[Set, T](Arbitrary.arbitrary[T])) prop> (s: Set[Int]) => | val av = new AttributeValue().withNS(s.toList.map(_.toString): _*) | DynamoFormat[Set[Int]].write(s) == av && | DynamoFormat[Set[Int]].read(av) == Right(s) >>> DynamoFormat[Set[Int]].write(Set.empty).getNULL true
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
iso[A, B](r: (B) ⇒ A)(w: (A) ⇒ B)(implicit f: DynamoFormat[B]): DynamoFormat[A] { val default: Option[A] }
Returns a DynamoFormat for the case where
AandBare isomorphic, i.e.Returns a DynamoFormat for the case where
AandBare isomorphic, i.e. anAcan always be converted to aBand vice versa.If there are some values of
Bthat have no corresponding value inA, use DynamoFormat.xmap or DynamoFormat.coercedXmap.>>> import com.amazonaws.services.dynamodbv2.model.AttributeValue >>> case class UserId(value: String) >>> implicit val userIdFormat = ... DynamoFormat.iso[UserId, String](UserId.apply)(_.value) >>> DynamoFormat[UserId].read(new AttributeValue().withS("Eric")) Right(UserId(Eric))
- val javaListFormat: DynamoFormat[List[AttributeValue]]
-
implicit
def
listFormat[T](implicit f: DynamoFormat[T]): DynamoFormat[List[T]]
prop> (l: List[String]) => | DynamoFormat[List[String]].read(DynamoFormat[List[String]].write(l)) == | Right(l)
-
implicit
val
longFormat: DynamoFormat[Long]
prop> (l: Long) => | DynamoFormat[Long].read(DynamoFormat[Long].write(l)) == Right(l)
-
implicit
val
longSetFormat: DynamoFormat[Set[Long]]
prop> import com.amazonaws.services.dynamodbv2.model.AttributeValue prop> import org.scalacheck._ prop> implicit def arbNonEmptySet[T: Arbitrary] = Arbitrary(Gen.nonEmptyContainerOf[Set, T](Arbitrary.arbitrary[T])) prop> (s: Set[Long]) => | val av = new AttributeValue().withNS(s.toList.map(_.toString): _*) | DynamoFormat[Set[Long]].write(s) == av && | DynamoFormat[Set[Long]].read(av) == Right(s) >>> DynamoFormat[Set[Long]].write(Set.empty).getNULL true
-
implicit
def
mapFormat[V](implicit f: DynamoFormat[V]): DynamoFormat[Map[String, V]]
prop> (m: Map[String, Int]) => | DynamoFormat[Map[String, Int]].read(DynamoFormat[Map[String, Int]].write(m)) == | Right(m)
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
implicit
def
optionFormat[T](implicit f: DynamoFormat[T]): DynamoFormat[Option[T]] { val default: Some[None.type] }
prop> (o: Option[Long]) => | DynamoFormat[Option[Long]].read(DynamoFormat[Option[Long]].write(o)) == | Right(o) >>> DynamoFormat[Option[Long]].read(new com.amazonaws.services.dynamodbv2.model.AttributeValue().withNULL(true)) Right(None)
-
implicit
def
seqFormat[T](implicit f: DynamoFormat[T]): DynamoFormat[Seq[T]]
prop> (sq: Seq[String]) => | DynamoFormat[Seq[String]].read(DynamoFormat[Seq[String]].write(sq)) == | Right(sq)
-
implicit
val
shortFormat: DynamoFormat[Short]
prop> (s: Short) => | DynamoFormat[Short].read(DynamoFormat[Short].write(s)) == Right(s)
-
implicit
def
someFormat[T](implicit f: DynamoFormat[T]): DynamoFormat[Some[T]]
This ensures that if, for instance, you specify an update with Some(5) rather than making the type of
Optionexplicit, it doesn't fall back to auto-derivation -
implicit
val
stringFormat: DynamoFormat[String]
prop> (s: String) => | DynamoFormat[String].read(DynamoFormat[String].write(s)) == Right(s)
-
implicit
val
stringSetFormat: DynamoFormat[Set[String]]
prop> import com.amazonaws.services.dynamodbv2.model.AttributeValue prop> import org.scalacheck._ prop> implicit val arbSet = Arbitrary(Gen.nonEmptyContainerOf[Set, String](Arbitrary.arbitrary[String])) prop> (s: Set[String]) => | val av = new AttributeValue().withSS(s.toList: _*) | DynamoFormat[Set[String]].write(s) == av && | DynamoFormat[Set[String]].read(av) == Right(s) >>> DynamoFormat[Set[String]].write(Set.empty).getNULL true
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
implicit
val
uuidFormat: DynamoFormat[UUID]
prop> implicit val arbitraryUUID = org.scalacheck.Arbitrary(org.scalacheck.Gen.uuid) prop> (uuid: java.util.UUID) => | DynamoFormat[java.util.UUID].read(DynamoFormat[java.util.UUID].write(uuid)) == | Right(uuid)
-
implicit
def
vectorFormat[T](implicit f: DynamoFormat[T]): DynamoFormat[Vector[T]]
prop> (v: Vector[String]) => | DynamoFormat[Vector[String]].read(DynamoFormat[Vector[String]].write(v)) == | Right(v)
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
xmap[A, B](r: (B) ⇒ Either[DynamoReadError, A])(w: (A) ⇒ B)(implicit f: DynamoFormat[B]): DynamoFormat[A]
>>> import org.joda.time._ >>> import com.amazonaws.services.dynamodbv2.model.AttributeValue >>> implicit val jodaLongFormat = DynamoFormat.xmap[DateTime, Long]( ... l => Right(new DateTime(l).withZone(DateTimeZone.UTC)) ... )( ... _.withZone(DateTimeZone.UTC).getMillis ... ) >>> DynamoFormat[DateTime].read(new AttributeValue().withN("0")) Right(1970-01-01T00:00:00.000Z)
- object nonInheritedOps extends ToDynamoFormatOps
- object ops