Converter

object Converter
Companion
class
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply[A, B](implicit c: Converter[A, B]): Converter[A, B]

Apply conversion using implicit Converter instance. This method catch a Converter instance in the scope that conforms with types F, A and B and then invoke in it the method apply passing a.

Apply conversion using implicit Converter instance. This method catch a Converter instance in the scope that conforms with types F, A and B and then invoke in it the method apply passing a.

Type Params
A

Contravariant input type

B

Output object type

Value Params
c

implicit Converter instance

Returns

Safe conversion of A into B, express as F[B]

def id[A]: Converter[A, A]

Create an always pure converter that return the input instance.

Create an always pure converter that return the input instance.

Type Params
A

input and output type

Returns

Identity Converter instance

def of[A, B](f: A => B): Converter[A, B]

Create an instance of Converter

Create an instance of Converter

Type Params
A

Input type

B

Output type

Value Params
f

function to map input to output

Returns

Converter instance

def pure[A, B](b: B): Converter[A, B]

Create an always pure converter that return the passed value ignoring the converter input.

Create an always pure converter that return the passed value ignoring the converter input.

Type Params
B

inner output type

Value Params
b

Inner value returned when the Converter is invoked, the converter input is ignored.

Returns

Constant Converter instance