package validator
Skinny validator provides easy-to-understand and readable DSLs to validate inputs.
- Alphabetic
- By Inheritance
- validator
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
Error
(name: String, messageParams: Seq[Any]) extends ErrorLike with Product with Serializable
Simple implementation of Error.
-
trait
ErrorLike
extends AnyRef
Validation error.
-
case class
Errors
(errors: Map[String, Seq[Error]]) extends Product with Serializable
Collection of errors.
Collection of errors.
- errors
Map value.
-
case class
FailuresProjection
[+A](results: Validations, onSuccess: (Parameters) ⇒ A, onFailures: (Parameters, Errors) ⇒ A) extends ResultsProjection[A] with Product with Serializable
Failures projection.
Failures projection.
- A
result type
- results
results
- onSuccess
success event handler
- onFailures
failure event handler
-
case class
Form
[A](validations: Validations, value: Option[A]) extends ValidatorLike with Product with Serializable
Form object.
Form object.
- A
raw value type
- validations
validations
- value
value if exists
-
case class
I18nKeyParam
(value: String) extends Product with Serializable
Key for skinny.I18n messages.
-
case class
KeyValueParamDefinition
(key: String, value: Any) extends ParamDefinition with Product with Serializable
Key and value param definition.
Key and value param definition.
- key
key
- value
value
-
case class
MapValidator
(paramMap: Map[String, Any] = Map(), validations: Validations = Validations(Map(), Nil)) extends ValidatorLike with Product with Serializable
Validator which accepts Map value as inputs.
Validator which accepts Map value as inputs.
- paramMap
param as a Map value
- validations
registered validations
-
class
Messages
extends AnyRef
Messages for validation errors.
-
case class
NewValidation
(paramDef: ParamDefinition, validations: ValidationRule) extends ValidationState with Product with Serializable
Newly created validation which hasn't be applied yet.
Newly created validation which hasn't be applied yet.
- paramDef
param definition
- validations
validation rules
-
case class
OnlyKeyParamDefinition
(key: String) extends ParamDefinition with Product with Serializable
Key param definition.
Key param definition.
- key
key
-
sealed
trait
ParamDefinition
extends AnyRef
Param definition.
-
trait
ParamValueTypeConverter
[S, T] extends AnyRef
Type converter
Type converter
- S
from
- T
to
- Annotations
- @implicitNotFound( ... )
-
sealed
trait
Parameters
extends AnyRef
Params
-
case class
ParametersFromMap
(map: Map[String, Any]) extends Parameters with ParametersGetAsImplicits with Product with Serializable
Params from a Map value.
Params from a Map value.
- map
Map value
-
case class
ParametersFromValidations
(validations: Validations) extends Parameters with ParametersGetAsImplicits with Product with Serializable
Params from validations.
Params from validations.
- validations
validations
-
sealed
trait
ResultsProjection
[+A] extends AnyRef
Results projection.
Results projection.
- A
result type
-
case class
SuccessesProjection
[+A](results: Validations, onSuccess: (Parameters) ⇒ A, onFailures: (Parameters, Errors) ⇒ A) extends ResultsProjection[A] with Product with Serializable
Successes projection.
Successes projection.
- A
result type
- results
results
- onSuccess
success event handler
- onFailures
failure event handler
-
case class
ValidationFailure
(paramDef: ParamDefinition, errors: Seq[Error]) extends ValidationState with Product with Serializable
Failure.
Failure.
- paramDef
param definition
- errors
errors
-
trait
ValidationRule
extends (KeyValueParamDefinition) ⇒ ValidationState with ErrorLike
Validation rule.
-
sealed
trait
ValidationState
extends AnyRef
Validation object which has param definition and validation results
-
case class
ValidationSuccess
(paramDef: ParamDefinition) extends ValidationState with Product with Serializable
Success.
Success.
- paramDef
param definition
-
trait
Validations
extends AnyRef
Validations container.
-
class
Validator
extends ValidatorLike
Validator.
-
trait
ValidatorLike
extends AnyRef
Validator like feature.
- case class doubleMaxValue (max: Double) extends ValidationRule with Product with Serializable
- case class doubleMinMaxValue (min: Double, max: Double) extends ValidationRule with Product with Serializable
- case class doubleMinValue (min: Double) extends ValidationRule with Product with Serializable
- case class floatMaxValue (max: Float) extends ValidationRule with Product with Serializable
- case class floatMinMaxValue (min: Float, max: Float) extends ValidationRule with Product with Serializable
- case class floatMinValue (min: Float) extends ValidationRule with Product with Serializable
- case class intMaxValue (max: Int) extends ValidationRule with Product with Serializable
- case class intMinMaxValue (min: Int, max: Int) extends ValidationRule with Product with Serializable
- case class intMinValue (min: Int) extends ValidationRule with Product with Serializable
- case class length (len: Int) extends ValidationRule with Product with Serializable
- case class longMaxValue (max: Long) extends ValidationRule with Product with Serializable
- case class longMinMaxValue (min: Long, max: Long) extends ValidationRule with Product with Serializable
- case class longMinValue (min: Long) extends ValidationRule with Product with Serializable
- case class maxLength (max: Int) extends ValidationRule with Product with Serializable
- case class minLength (min: Int) extends ValidationRule with Product with Serializable
- case class minMaxLength (min: Int, max: Int) extends ValidationRule with Product with Serializable
- case class notEmpty (trim: Boolean = true) extends ValidationRule with Product with Serializable
- case class required (trim: Boolean = true) extends ValidationRule with Product with Serializable
Value Members
-
def
checkAll(validationRules: ValidationRule*): ValidationRule
Converts validation rules to a combined validation rule which verify all the rules even if some of them has errors.
Converts validation rules to a combined validation rule which verify all the rules even if some of them has errors.
- validationRules
validation rules
- returns
validation rule
-
implicit
def
convertParamDefinitionToParamDefinitionWithIs(paramDef: ParamDefinition): ParamDefinitionWithIsDSL
Converts ParamDefinition to ParamDefinitionWithIsDSL implicitly.
Converts ParamDefinition to ParamDefinitionWithIsDSL implicitly.
- paramDef
param definition
- returns
with dsl
-
def
param(kv: (String, Any)): KeyValueParamDefinition
Accepts key and value.
Accepts key and value.
- kv
key and value
- returns
param definition
-
def
paramKey(name: String): OnlyKeyParamDefinition
Accepts key.
Accepts key.
- name
key
- returns
param definition
-
object
Error
extends Serializable
Factory
-
object
Messages
Messages loader.
-
object
ResultsProjection
Results projection.
-
object
Validations
Validations factory.
-
object
Validator
Validator factory.
- object dateFormat extends ValidationRule
- object dateTimeFormat extends ValidationRule
- object doubleValue extends ValidationRule
- object email extends ValidationRule
- object floatValue extends ValidationRule
- object future extends ValidationRule
- object intValue extends ValidationRule
- object longValue extends ValidationRule
- object notEmpty extends notEmpty
-
object
notNull
extends ValidationRule
Built-in validation rules.
- object numeric extends ValidationRule
- object past extends ValidationRule
- object required extends required
- object same extends ValidationRule
- object timeFormat extends ValidationRule