Package ca.uhn.hl7v2.validation.builder
Class BuilderSupport
java.lang.Object
ca.uhn.hl7v2.validation.builder.BuilderSupport
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
RuleTypeBuilder
Abstract base class for Validation Rule building that provides factory methods for
Predicates.- Author:
- Christian Ohr
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionalways(boolean b) date()dateTime()empty()Equivalent with allOf(isEqual(allowed[0]), ..., isEqual(allowed[n-1])in(Collection<?> allowed) isEqualIgnoreCase(Object expected) maxLength(int maxSize) number()oid()startsWith(String prefix) time()uuid()
-
Constructor Details
-
BuilderSupport
protected BuilderSupport()
-
-
Method Details
-
isEqual
- Parameters:
expected- expected value- Returns:
- a predicate that evaluates to
trueif the expected value equals the actual value
-
isEqualIgnoreCase
- Parameters:
expected- expected value- Returns:
- a predicate that evaluates to
trueif the expected value case-insensitively equals the actual value
-
empty
- Returns:
- a predicate that evaluates to
trueif the actual value is null, has zero length or is explicitly "empty" as HL7 defines it ("").
-
emptyOr
- Parameters:
predicate- the predicate to evaluate if not empty- Returns:
- a predicate that evaluates to
trueif the actual value is empty or the passed predicate evaluates to true.
-
matches
- Parameters:
regex- regular expression- Returns:
- a predicate that evaluates to
trueif the actual value matches the regular expression
-
matches
- Parameters:
regex- regular expressiondescription- custom descriptiom for this regex- Returns:
- a predicate that evaluates to
trueif the actual value matches the regular expression
-
startsWith
- Parameters:
prefix- prefix string- Returns:
- a predicate that evaluates to
trueif the actual value starts with the specified prefix.
-
nonNegativeInteger
- Returns:
- a predicate that evaluates to
trueif the actual value can be parsed into a non-negative integer.
-
number
- Returns:
- a predicate that evaluates to
trueif the actual value can be parsed into a number with optional decimal digits.
-
date
- Returns:
- a predicate that evaluates to
trueif the actual value matches a HL7 date pattern (YYYY[MM[DD]])
-
time
- Returns:
- a predicate that evaluates to
trueif the actual value matches a HL7 time pattern
-
dateTime
- Returns:
- a predicate that evaluates to
trueif the actual value matches a HL7 datetime pattern
-
dateTime25
- Returns:
- a predicate that evaluates to
trueif the actual value matches a HL7 datetime pattern
-
usPhoneNumber
- Returns:
- a predicate that evaluates to
trueif the actual value matches a US phone number pattern
-
oid
- Returns:
- a predicate that evaluates to
trueif the actual value matches an ISO OID pattern
-
uuid
- Returns:
- a predicate that evaluates to
trueif the actual value matches a UUID pattern
-
matches
- Parameters:
regex- regular expressionflags- regular expression flags- Returns:
- a predicate that evaluates to
trueif the actual value matches the regular expression
-
in
Equivalent with allOf(isEqual(allowed[0]), ..., isEqual(allowed[n-1])- Parameters:
allowed- allowed values- Returns:
- a predicate that evaluates to
trueif the actual value occurs in he specified array of objects
-
in
- Parameters:
allowed- allowed values- Returns:
- a predicate that evaluates to
trueif the actual value occurs in he specified collection of objects
-
anyOf
- Parameters:
predicates- predicates of which one shall evaluate to true- Returns:
- a predicate that evaluates to
trueif any of the specified predicates evaluates totrue
-
allOf
- Parameters:
predicates- predicates of which all shall evaluate to true- Returns:
- a predicate that evaluates to
trueif all of the specified predicates evaluate totrue
-
anyOf
- Parameters:
predicates- predicates of which one shall evaluate to true- Returns:
- a predicate that evaluates to
trueif any of the specified predicates evaluates totrue
-
allOf
- Parameters:
predicates- predicates of which all shall evaluate to true- Returns:
- a predicate that evaluates to
trueif all of the specified predicates evaluate totrue
-
not
- Parameters:
predicate- predicate to be negated- Returns:
- a predicate that evaluates to
trueif the specified predicate evaluate tofalse
-
maxLength
- Parameters:
maxSize- maximal length of the value- Returns:
- a predicate that evaluates to
trueif the length of the actual value is equal or shorter than the specified length
-
withdrawn
- Returns:
- a predicate that evaluates to
falsegiving the reason that the message element has been withdrawn and should not be used anymore.
-
always
- Returns:
- a predicate that evaluates to the specified boolean value
-
alwaysFails
- Returns:
- a predicate that evaluates to
false
-