abstract class ThriftValidator extends BaseValidator
Implement this class to define a validator with custom validations.
- Alphabetic
- By Inheritance
- ThriftValidator
- BaseValidator
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new ThriftValidator()
Abstract Value Members
-
abstract
def
customAnnotations: Map[String, ThriftConstraintValidator[_, _]]
A map of String annotations to ThriftConstraintValidator.
A map of String annotations to ThriftConstraintValidator.
- Note
Must override this method to define all custom validations in an implementation of ThriftValidator.
,There is a Java helper
toScalaMap, which takes a java.util.Map and return a scala.collection.immutable.Map forcustomAnnotations.
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.
- Definition Classes
- BaseValidator
-
def
annotations: Set[String]
All custom annotations defined in this validator.
All custom annotations defined in this validator.
- Definition Classes
- ThriftValidator → BaseValidator
-
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
-
final
def
toScalaMap(javaMap: Map[String, ThriftConstraintValidator[_, _]]): Map[String, ThriftConstraintValidator[_, _]]
A helper method that converts a java.util.Map to a scala.collection.immutable.Map
A helper method that converts a java.util.Map to a scala.collection.immutable.Map
- Attributes
- protected
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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.
- Definition Classes
- ThriftValidator → BaseValidator
- Note
See a Java-friendly version of
validateFieldthat takes fieldAnnotations as a java.util.Map, and return a set of ThriftValidationViolations as java.util.Set in BaseValidator.validateField().
-
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.
A Java-friendly version of validateField, that takes fieldAnnotations as a java.util.Map, and return a set of ThriftValidationViolations as java.util.Set.
- Definition Classes
- BaseValidator
-
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()