Package ar.com.florius.koncierge.internal

Batteries included part.

Abandon all hope, all yee who enter here!!

Types

EvalError
Link copied to clipboard

This class has no useful logic; it's just a wrapper an evaluation error.

An evaluation error is considered as a negative match on evaluation. e.g.: diving into an empty object, is an EvalError, but will simply not match the experiment definition when evaluate is called.

inline class EvalError(s: String)
ParseError
Link copied to clipboard

This class has no useful logic; it's just a wrapper an parser error.

inline class ParseError(s: String)

Functions

evaluate
Link copied to clipboard

Given a world, a context (with an experiment), evaluates the list of variants for it. Note: the experiment is a sinlge one, and not the experiment definition

fun evaluate(world: World, context: Context): List<Variant>
gson
Link copied to clipboard

Helper function to use the same settigns across all the com.google.gson.Gson parsers

fun gson(): Gson
parseAll
Link copied to clipboard

Given a JSON definition, it attempts to parse it into a list of experiments

The definition should be a JSON object with at least one experiment definition. The error reporting halts on the first encountered error. It does not report a list of errors.

fun parseAll(definition: JsonElement): Either<ParseError, List<Experiment>>

Given a definition in JSON format, it parses it and parses it

fun parseAll(definition: String): Either<ParseError, List<Experiment>>
smear
Link copied to clipboard
fun smear(s: String): Float