Field

smithy4s.schema.Field
See theField companion object
final case class Field[S, A](label: String, schema: Schema[A], get: S => A)

Represents a member of product type (case class)

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def addHints(newHints: Hint*): Field[S, A]
def addHints(newHints: Hints): Field[S, A]
def contramap[S0](f: S0 => S): Field[S0, A]
def foreachUnlessDefault(s: S)(f: A => Unit): Unit

Applies a side-effecting lambda if the field is marked as required (using smithy.api#required), OR if the field value is different from its default. Otherwise nothing happens.

Applies a side-effecting lambda if the field is marked as required (using smithy.api#required), OR if the field value is different from its default. Otherwise nothing happens.

Attributes

def getUnlessDefault(s: S): Option[A]

If the field is marked as required (using smithy.api#required) OR if the field value is different from its default, returns the value. Otherwise returns None.

If the field is marked as required (using smithy.api#required) OR if the field value is different from its default, returns the value. Otherwise returns None.

Attributes

final def hints: Hints

Returns all hints : the ones defined directly on the field, and the ones defined on the target of the field.

Returns all hints : the ones defined directly on the field, and the ones defined on the target of the field.

Attributes

def isDefaultValue(a: A): Boolean
final def memberHints: Hints

Returns the hints that are only relative to the field (typically derived from member-level traits)

Returns the hints that are only relative to the field (typically derived from member-level traits)

Attributes

Deprecated methods

final def instance: Schema[A]

Attributes

Deprecated
[Since version 0.18.0]

Attributes

Deprecated
[Since version 0.18.4]

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Concrete fields

lazy val getDefaultValue: Option[A]