ParameterBinder

com.softinio.duck4s.algebra.ParameterBinder
See theParameterBinder companion trait

Companion object providing implicit ParameterBinder instances for common types.

This object contains given instances for primitive types (Int, Long, Double, String, Boolean) and Option types, providing automatic parameter binding for these common cases.

Attributes

Since

0.1.0

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

Implicit ParameterBinder for Boolean values.

Implicit ParameterBinder for Boolean values.

Attributes

Since

0.1.0

Example
batch.addBatch(("Product A", true)) // true for active
Supertypes
class Object
trait Matchable
class Any
Self type

Implicit ParameterBinder for Double values.

Implicit ParameterBinder for Double values.

Attributes

Since

0.1.0

Example
batch.addBatch(("Product", 19.99))
Supertypes
class Object
trait Matchable
class Any
Self type
object intBinder extends ParameterBinder[Int]

Implicit ParameterBinder for Int values.

Implicit ParameterBinder for Int values.

Attributes

Since

0.1.0

Example
 // Used automatically in batch operations batch.addBatch(("Alice",
 25)) // 25 bound as Int 
Supertypes
class Object
trait Matchable
class Any
Self type
intBinder.type
object longBinder extends ParameterBinder[Long]

Implicit ParameterBinder for Long values.

Implicit ParameterBinder for Long values.

Attributes

Since

0.1.0

Example
batch.addBatch((1234567890L, "data"))
Supertypes
class Object
trait Matchable
class Any
Self type
longBinder.type

Implicit ParameterBinder for String values.

Implicit ParameterBinder for String values.

Attributes

Since

0.1.0

Example
batch.addBatch(("Alice", "Engineer"))
Supertypes
class Object
trait Matchable
class Any
Self type

Givens

Givens

Implicit ParameterBinder for Boolean values.

Implicit ParameterBinder for Boolean values.

Attributes

Since

0.1.0

Example
batch.addBatch(("Product A", true)) // true for active

Implicit ParameterBinder for Double values.

Implicit ParameterBinder for Double values.

Attributes

Since

0.1.0

Example
batch.addBatch(("Product", 19.99))

Implicit ParameterBinder for Int values.

Implicit ParameterBinder for Int values.

Attributes

Since

0.1.0

Example
 // Used automatically in batch operations batch.addBatch(("Alice",
 25)) // 25 bound as Int 

Implicit ParameterBinder for Long values.

Implicit ParameterBinder for Long values.

Attributes

Since

0.1.0

Example
batch.addBatch((1234567890L, "data"))
given optionBinder[T](using binder: ParameterBinder[T]): optionBinder[T]

Implicit ParameterBinder for Option values.

Implicit ParameterBinder for Option values.

This binder handles nullable parameters by binding the wrapped value if present, or NULL if the Option is None.

Type parameters

T

the type of the wrapped value

Value parameters

binder

implicit ParameterBinder for the wrapped type T

Attributes

Returns

a ParameterBinder for Option[T]

Since

0.1.0

Example
 // Some values are bound normally, None becomes NULL batch.addBatch(
 ("Alice", Some(25)), // age = 25 ("Bob", None) // age = NULL ) 

Implicit ParameterBinder for String values.

Implicit ParameterBinder for String values.

Attributes

Since

0.1.0

Example
batch.addBatch(("Alice", "Engineer"))