DynamoFormat

org.scanamo.DynamoFormat
See theDynamoFormat companion trait

Attributes

Companion
trait
Graph
Supertypes
trait Derivation[DynamoFormat]
trait SealedTraitDerivation
trait CommonDerivation[DynamoFormat]
class Object
trait Matchable
class Any
Show all
Self type

Members list

Type members

Classlikes

object ObjectFormat

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait ObjectFormat[T] extends DynamoFormat[T]

DynamoFormats for object-like structures

DynamoFormats for object-like structures

Attributes

Note

All data types used as the carrier type in Table operations should derive an instance from this class

Companion
object
Supertypes
trait DynamoFormat[T]
class Object
trait Matchable
class Any

Inherited types

type FieldName = String

Attributes

Inherited from:
FormatDerivation (hidden)
type Typeclass[A] = DynamoFormat[A]

Attributes

Inherited from:
FormatDerivation (hidden)
type Valid[A] = Either[Type[(FieldName, DynamoReadError)], A]

Attributes

Inherited from:
FormatDerivation (hidden)

Value members

Concrete methods

def apply[T](implicit D: DynamoFormat[T]): DynamoFormat[T]
def coercedXmap[A, B : DynamoFormat, T >: Null <: Throwable : ClassTag](read: B => A, write: A => B): DynamoFormat[A]

Returns a DynamoFormat for the case where A can always be converted B, with write, but read may throw an exception for some value of B

Returns a DynamoFormat for the case where A can always be converted B, with write, but read may throw an exception for some value of B

Attributes

def iso[A, B](r: B => A, w: A => B)(implicit f: DynamoFormat[B]): DynamoFormat[A]

Returns a DynamoFormat for the case where A and B are isomorphic, i.e. an A can always be converted to a B and vice versa.

Returns a DynamoFormat for the case where A and B are isomorphic, i.e. an A can always be converted to a B and vice versa.

If there are some values of B that have no corresponding value in A, use DynamoFormat.xmap or DynamoFormat.coercedXmap.

Attributes

def xmap[A, B](r: B => Either[DynamoReadError, A], w: A => B)(implicit f: DynamoFormat[B]): DynamoFormat[A]

Returns a DynamoFormat for the case where A and B form an epimorphism, i.e. an A can always be converted to a B but the opposite is not necessarily true.

Returns a DynamoFormat for the case where A and B form an epimorphism, i.e. an A can always be converted to a B but the opposite is not necessarily true.

Attributes

Inherited methods

inline def `getParams__`[T, Labels <: Tuple, Params <: Tuple](annotations: Map[String, List[Any]], inheritedAnnotations: Map[String, List[Any]], typeAnnotations: Map[String, List[Any]], repeated: Map[String, Boolean], defaults: Map[String, Option[() => Any]], idx: Int): List[Param[Typeclass, T]]

Attributes

Inherited from:
CommonDerivation
inline override protected def deriveSubtype[s](m: Of[s]): DynamoFormat[s]

Attributes

Definition Classes
Derivation -> SealedTraitDerivation
Inherited from:
Derivation
inline def derived[A](using Of[A]): DynamoFormat[A]

Attributes

Inherited from:
Derivation
inline def derivedMirror[A](using mirror: Of[A]): DynamoFormat[A]

Attributes

Inherited from:
Derivation
inline def derivedMirrorProduct[A](product: ProductOf[A]): DynamoFormat[A]

Attributes

Inherited from:
CommonDerivation
inline def derivedMirrorSum[A](sum: SumOf[A]): DynamoFormat[A]

Attributes

Inherited from:
Derivation
inline def getParams[T, Labels <: Tuple, Params <: Tuple](annotations: Map[String, List[Any]], typeAnnotations: Map[String, List[Any]], repeated: Map[String, Boolean], idx: Int): List[Param[Typeclass, T]]

Attributes

Inherited from:
CommonDerivation
inline def getParams_[T, Labels <: Tuple, Params <: Tuple](annotations: Map[String, List[Any]], inheritedAnnotations: Map[String, List[Any]], typeAnnotations: Map[String, List[Any]], repeated: Map[String, Boolean], idx: Int): List[Param[Typeclass, T]]

Attributes

Inherited from:
CommonDerivation
def join[T](cc: CaseClass[Typeclass, T]): DynamoFormat[T]

Must be implemented by the user of Magnolia to construct a typeclass for case class T using the provided type info. E.g. if we are deriving Show[T] typeclasses, and T is a case class Foo(...), we need to constuct Show[Foo].

Must be implemented by the user of Magnolia to construct a typeclass for case class T using the provided type info. E.g. if we are deriving Show[T] typeclasses, and T is a case class Foo(...), we need to constuct Show[Foo].

This method is called 'join' because typically it will join together the typeclasses for all the parameters of the case class, into a single typeclass for the case class itself. The field CaseClass.params can provide useful information for doing this.

Value parameters

caseClass

information about the case class T, its parameters, and their typeclasses

Attributes

Inherited from:
FormatDerivation (hidden)
inline protected def sealedTraitFromMirror[A](m: SumOf[A]): SealedTrait[Typeclass, A]

Attributes

Inherited from:
SealedTraitDerivation
def split[T](st: SealedTrait[Typeclass, T]): DynamoFormat[T]

This must be implemented by the user of Magnolia to construct a Typeclass for 'T', where 'T' is a Sealed Trait or Scala 3 Enum, using the provided type info. E.g. if we are deriving 'Show[T]' typeclasses, and T is an enum 'Suit' (eg with values Diamonds, Clubs, etc), we need to constuct 'Show[Suit]'.

This must be implemented by the user of Magnolia to construct a Typeclass for 'T', where 'T' is a Sealed Trait or Scala 3 Enum, using the provided type info. E.g. if we are deriving 'Show[T]' typeclasses, and T is an enum 'Suit' (eg with values Diamonds, Clubs, etc), we need to constuct 'Show[Suit]'.

This method is called 'split' because it will ''split'' the different possible types of the SealedTrait, and handle each one to finally produce a typeclass capable of handling any possible subtype of the trait.

A useful function for implementing this method is SealedTrait#choose, which can take a value instance and provide information on the specific subtype of the sealedTrait which that value is.

Attributes

Inherited from:
FormatDerivation (hidden)
transparent inline def subtypes[T, SubtypeTuple <: Tuple](m: SumOf[T], idx: Int): List[Subtype[Typeclass, T, _]]

Attributes

Inherited from:
Derivation
transparent inline protected def subtypesFromMirror[A, SubtypeTuple <: Tuple](m: SumOf[A], idx: Int): List[Subtype[Typeclass, A, _]]

Attributes

Inherited from:
SealedTraitDerivation

Implicits

Implicits

implicit def arrayFormat[T : ClassTag](implicit evidence$1: ClassTag[T], f: DynamoFormat[T]): DynamoFormat[Array[T]]
implicit val byteBufferFormat: DynamoFormat[ByteBuffer]
implicit val byteFormat: DynamoFormat[Byte]
implicit val floatFormat: DynamoFormat[Float]
implicit def genericSet[T : DynamoFormat]: DynamoFormat[Set[T]]
implicit val instantAsLongFormat: DynamoFormat[Instant]

Format for dealing with points in time stored as the number of milliseconds since Epoch.

Format for dealing with points in time stored as the number of milliseconds since Epoch.

Attributes

implicit val intFormat: DynamoFormat[Int]
implicit val intSetFormat: DynamoFormat[Set[Int]]
implicit def listFormat[T](implicit f: DynamoFormat[T]): DynamoFormat[List[T]]
implicit val longFormat: DynamoFormat[Long]
implicit def mapFormat[V](implicit f: DynamoFormat[V]): DynamoFormat[Map[String, V]]
implicit val offsetDateTimeFormat: DynamoFormat[OffsetDateTime]

Format for dealing with date-times with an offset from UTC.

Format for dealing with date-times with an offset from UTC.

Attributes

implicit def optionFormat[T](implicit f: DynamoFormat[T]): DynamoFormat[Option[T]]
implicit def seqFormat[T](implicit f: DynamoFormat[T]): DynamoFormat[Seq[T]]
implicit val shortFormat: DynamoFormat[Short]
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 Option explicit, it doesn't fall back to auto-derivation

This ensures that if, for instance, you specify an update with Some(5) rather than making the type of Option explicit, it doesn't fall back to auto-derivation

Attributes

implicit val uuidFormat: DynamoFormat[UUID]
implicit def vectorFormat[T](implicit f: DynamoFormat[T]): DynamoFormat[Vector[T]]
implicit val zonedDateTimeFormat: DynamoFormat[ZonedDateTime]

Format for dealing with date-times with a time zone in the ISO-8601 calendar system.

Format for dealing with date-times with a time zone in the ISO-8601 calendar system.

Attributes

Inherited implicits

implicit def generic[A](implicit A: Exported[DynamoFormat[A]]): DynamoFormat[A]

Attributes

Inherited from:
PlatformSpecificFormat