abstract class BaseValidator extends AnyRef
An interface to define APIs for default validations (depend on
com.twitter.util.validation.ScalaValidator) and custom
validations.
- Alphabetic
- By Inheritance
- BaseValidator
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new BaseValidator()
Abstract Value Members
-
abstract
def
annotations: Set[String]
All annotations defined in this validator.
-
abstract
def
validateField[T](fieldName: String, fieldValue: T, fieldAnnotations: Map[String, String]): Set[ThriftValidationViolation]
Validate a field value against its annotation.
Validate a field value against its annotation.
- T
The type of the field.
- fieldName
The name of the field.
- fieldValue
The value of the field to be validated.
- fieldAnnotations
The annotation name and its value set on the field in Thrift IDL.
- returns
A set of ThriftValidationViolations for violated constraints. Return an empty set if all validations passed.
- Note
See a Java-friendly version of validateField that takes fieldAnnotations as a java.util.Map, and return a set of ThriftValidationViolations as java.util.Set.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
annotationIsDefined(annotation: String): Boolean
Check if a given annotation is already defined.
Check if a given annotation is already defined.
- annotation
the String annotation defined on IDL.
- returns
true if the annotation is already defined.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
validateField[T](fieldName: String, fieldValue: T, fieldAnnotations: Map[String, String]): Set[ThriftValidationViolation]
A Java-friendly version of validateField, that takes fieldAnnotations as a java.util.Map, and return a set of ThriftValidationViolations as java.util.Set.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()