package thrift_validation
- Alphabetic
- Public
- All
Type Members
-
abstract
class
BaseValidator extends AnyRef
An interface to define APIs for default validations (depend on
com.twitter.util.validation.ScalaValidator) and custom validations. -
trait
ThriftConstraintValidator[T, A >: Int with Long with Double with Short with Byte with String] extends AnyRef
The trait to define a ThriftConstraintValidator, this is used in ThriftValidatorto validate annotations on Thrift IDL.
The trait to define a ThriftConstraintValidator, this is used in ThriftValidatorto validate annotations on Thrift IDL.
- T
The type of the field to be validated.
- A
The type of the annotation value to be validated against.
- Note
A must be a super type of Int, Long, Double, Short, Byte, or String.
-
final
case class
ThriftValidationException(endpoint: String, requestClazz: Class[_], validationViolations: Set[ThriftValidationViolation]) extends RuntimeException with Product with Serializable
An exception which is used to communicate when a thrift_validation has failed with the respective ThriftValidationViolation
An exception which is used to communicate when a thrift_validation has failed with the respective ThriftValidationViolation
- endpoint
thrift method the invalid request tries to reach
- requestClazz
the type of request that was passed in
- validationViolations
all violations collected while deserializing the thrift object
-
case class
ThriftValidationViolation(fieldName: String, fieldValue: Any, violationMessage: String) extends Product with Serializable
To store the data for failed validations.
To store the data for failed validations.
- fieldName
the name of the field being validated.
- fieldValue
the value of the field being validated.
- violationMessage
the validation failure message.
-
abstract
class
ThriftValidator extends BaseValidator
Implement this class to define a validator with custom validations.
Value Members
- object DefaultAnnotations
- object ThriftValidationException extends Serializable
- object ThriftValidator