Utils

org.encalmo.lambda.Utils
object Utils

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Utils.type

Members list

Type members

Classlikes

class MarshallingError(reason: String, source: String) extends Exception

Attributes

Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
class UnmarshallingError(reason: String, source: String) extends Exception

Attributes

Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Types

type TransformValue = PartialFunction[Value, Value]

Value members

Concrete methods

Concrete fields

Extensions

Extensions

extension [L, R](either: Either[L, R])
inline def writeAsJson: Value
inline def writeAsJsonObject: Obj
inline def writeAsString: String
extension [T](entity: T)
inline def writeAsJson: Value
inline def writeAsJsonObject: Obj
inline def writeAsString: String
extension [T, R <: Request[T]](request: R)
def printDebug(debug: String => Unit): R
extension (response: Response[String])
def printDebug(debug: String => Unit): Response[String]
extension (string: String)
inline def maybeReadAs[T : ReadWriter]: Option[T]
inline def maybeReadAsEither[L : ReadWriter, R : ReadWriter]: Option[Either[L, R]]
inline def maybeReadAsJson: Option[Value]
inline def readAs[T : ReadWriter]: T
inline def readAsEither[L : ReadWriter, R : ReadWriter]: Either[L, R]
inline def readAsJson: Value
extension [T](value: Option[T])
inline def rightOrElse[L](alternative: => Either[L, T]): Either[L, T]
inline def writeAsJsonOrNull: Value
extension (value: Value)
infix def +(field: (String, Value)): Obj
infix def -(key: String): Obj
inline def get(path: String): Option[Value]

Retrieve some value at json path, or return None.

Retrieve some value at json path, or return None.

Attributes

inline def getBoolean(p: String): Boolean
inline def getByPath(path: String): Option[Value]

Retrieve some value at json path, or return None.

Retrieve some value at json path, or return None.

Attributes

inline def getInt(p: String): Int
inline def getString(p: String): String
inline def maybeBoolean(p: String): Option[Boolean]
inline def maybeInt(p: String): Option[Int]
inline def maybeReadAs[T]: Option[T]
inline def maybeReadAsEither[L : ReadWriter, R : ReadWriter]: Option[Either[L, R]]
inline def maybeString(p: String): Option[String]
inline def readAs[T]: T
inline def readAsEither[L : ReadWriter, R : ReadWriter]: Either[L, R]
inline def readByPath[T](path: String): Option[T]

Retrieve some entitty at json path, or return None.

Retrieve some entitty at json path, or return None.

Attributes

inline def remove(path: String): Unit

Remove value at json path, if exists.

Remove value at json path, if exists.

Attributes

inline def set(path: String, string: String): value.type

Set string value at json path, create missing path parts if needed.

Set string value at json path, create missing path parts if needed.

Attributes

inline def set(path: String, number: Int): value.type

Set integer value at json path, create missing path parts if needed.

Set integer value at json path, create missing path parts if needed.

Attributes

inline def set(path: String, number: Double): value.type

Set double value at json path, create missing path parts if needed.

Set double value at json path, create missing path parts if needed.

Attributes

inline def set(path: String, boolean: Boolean): value.type

Set boolean value at json path, create missing path parts if needed.

Set boolean value at json path, create missing path parts if needed.

Attributes

inline def set(path: String, valueToSet: Value, force: Boolean): value.type

Set value at json path. If force=true then create missing path parts.

Set value at json path. If force=true then create missing path parts.

Attributes

inline def setByPath(path: String, valueToSet: Value, force: Boolean): value.type
inline def transform(path: String, transform: TransformValue, force: Boolean): value.type

Transform value at json path. If force=true then create missing path parts.

Transform value at json path. If force=true then create missing path parts.

Attributes

inline def writeByPath[T : ReadWriter](path: String, valueToSet: T, force: Boolean): value.type
extension [L, R](value: Either[L, R])
inline def forget: Either[L, Unit]
inline def tap(f: (Either[L, R]) => Unit): value.type
inline def tapLeft(f: L => Unit): value.type
inline def tapRight(f: R => Unit): value.type
extension [T](value: Option[T])
inline def tap(f: (Option[T]) => Unit): value.type
inline def tapNone(f: => Unit): value.type
inline def tapSome(f: T => Unit): value.type
extension [T](value: Either[Error, Option[T]])
inline def flatMapE[R](f: T => Either[Error, R]): Either[Error, Option[R]]
inline def flatMapEO[R](f: T => Either[Error, Option[R]]): Either[Error, Option[R]]
extension [T](value: Either[Throwable, T])
inline def eitherErrorOr[R](result: R): Either[Error, R]
inline def eitherErrorOrResult: Either[Error, T]
extension [T](value: Either[Throwable, Either[Error, T]])