java.lang.Object
dev.metaschema.core.metapath.function.ComparisonFunctions
A collection of comparison functions supporting value and general
comparisons.
Based on the XPath 3.1 comparison expressions syntax.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic IBooleanItembinaryCompare(IBase64BinaryItem left, ComparisonFunctions.Operator operator, IBase64BinaryItem right) Perform a binary data-based comparison of therightitem against theleftitem using the specifiedoperator.static IBooleanItembooleanCompare(IBooleanItem left, ComparisonFunctions.Operator operator, IBooleanItem right) Perform a boolean-based comparison of therightitem against theleftitem using the specifiedoperator.static IBooleanItemcompare(IAnyAtomicItem left, ComparisonFunctions.Operator operator, IAnyAtomicItem right, DynamicContext dynamicContext) Compare therightitem with theleftitem using the specifiedoperator.static IBooleanItemdateTimeCompare(IDateTimeItem left, ComparisonFunctions.Operator operator, IDateTimeItem right, DynamicContext dynamicContext) Perform a date and time-based comparison of therightitem against theleftitem using the specifiedoperator.static IBooleanItemdurationCompare(IDurationItem left, ComparisonFunctions.Operator operator, IDurationItem right) Perform a duration-based comparison of therightitem against theleftitem using the specifiedoperator.static IBooleanItemgeneralComparison(ISequence<? extends IAnyAtomicItem> leftItems, ComparisonFunctions.Operator operator, ISequence<? extends IAnyAtomicItem> rightItems, DynamicContext dynamicContext) Compare the sets of atomic items.static IBooleanItemnumericCompare(INumericItem left, ComparisonFunctions.Operator operator, INumericItem right) Perform a number-based comparison of therightitem against theleftitem using the specifiedoperator.static IBooleanItemstringCompare(IStringItem left, ComparisonFunctions.Operator operator, IStringItem right) Perform a string-based comparison of therightitem against theleftitem using the specifiedoperator.static IBooleanItemvalueCompairison(IAnyAtomicItem leftItem, ComparisonFunctions.Operator operator, IAnyAtomicItem rightItem, DynamicContext dynamicContext) Compare the two items using the providedoperator.
-
Method Details
-
valueCompairison
@NonNull public static IBooleanItem valueCompairison(@NonNull IAnyAtomicItem leftItem, @NonNull ComparisonFunctions.Operator operator, @NonNull IAnyAtomicItem rightItem, @Nullable DynamicContext dynamicContext) Compare the two items using the providedoperator.- Parameters:
leftItem- the first item to compareoperator- the comparison operatorrightItem- the second item to comparedynamicContext- used to get the implicit timezone from the evaluation context- Returns:
- the result of the comparison
-
generalComparison
@NonNull public static IBooleanItem generalComparison(@NonNull ISequence<? extends IAnyAtomicItem> leftItems, @NonNull ComparisonFunctions.Operator operator, @NonNull ISequence<? extends IAnyAtomicItem> rightItems, @NonNull DynamicContext dynamicContext) Compare the sets of atomic items.- Parameters:
leftItems- the first set of items to compareoperator- the comparison operatorrightItems- the second set of items to comparedynamicContext- used to get the implicit timezone from the evaluation context- Returns:
- a or an empty
ISequenceif either item isnull
-
compare
@NonNull public static IBooleanItem compare(@NonNull IAnyAtomicItem left, @NonNull ComparisonFunctions.Operator operator, @NonNull IAnyAtomicItem right, @Nullable DynamicContext dynamicContext) Compare therightitem with theleftitem using the specifiedoperator.- Parameters:
left- the value to compare againstoperator- the comparison operatorright- the value to compare withdynamicContext- used to get the implicit timezone from the evaluation context- Returns:
- the comparison result
-
stringCompare
@NonNull public static IBooleanItem stringCompare(@NonNull IStringItem left, @NonNull ComparisonFunctions.Operator operator, @NonNull IStringItem right) Perform a string-based comparison of therightitem against theleftitem using the specifiedoperator.- Parameters:
left- the value to compare againstoperator- the comparison operatorright- the value to compare with- Returns:
- the comparison result
-
numericCompare
@NonNull public static IBooleanItem numericCompare(@NonNull INumericItem left, @NonNull ComparisonFunctions.Operator operator, @NonNull INumericItem right) Perform a number-based comparison of therightitem against theleftitem using the specifiedoperator.- Parameters:
left- the value to compare againstoperator- the comparison operatorright- the value to compare with- Returns:
- the comparison result
-
booleanCompare
@NonNull public static IBooleanItem booleanCompare(@NonNull IBooleanItem left, @NonNull ComparisonFunctions.Operator operator, @NonNull IBooleanItem right) Perform a boolean-based comparison of therightitem against theleftitem using the specifiedoperator.- Parameters:
left- the value to compare againstoperator- the comparison operatorright- the value to compare with- Returns:
- the comparison result
-
dateTimeCompare
@NonNull public static IBooleanItem dateTimeCompare(@NonNull IDateTimeItem left, @NonNull ComparisonFunctions.Operator operator, @NonNull IDateTimeItem right, @Nullable DynamicContext dynamicContext) Perform a date and time-based comparison of therightitem against theleftitem using the specifiedoperator.- Parameters:
left- the value to compare againstoperator- the comparison operatorright- the value to compare withdynamicContext- used to get the implicit timezone from the evaluation context- Returns:
- the comparison result
-
durationCompare
@NonNull public static IBooleanItem durationCompare(@NonNull IDurationItem left, @NonNull ComparisonFunctions.Operator operator, @NonNull IDurationItem right) Perform a duration-based comparison of therightitem against theleftitem using the specifiedoperator.- Parameters:
left- the value to compare againstoperator- the comparison operatorright- the value to compare with- Returns:
- the comparison result
-
binaryCompare
@NonNull public static IBooleanItem binaryCompare(@NonNull IBase64BinaryItem left, @NonNull ComparisonFunctions.Operator operator, @NonNull IBase64BinaryItem right) Perform a binary data-based comparison of therightitem against theleftitem using the specifiedoperator.- Parameters:
left- the value to compare againstoperator- the comparison operatorright- the value to compare with- Returns:
- the comparison result
-