* {@inheritDoc}
*/
public final ConditionResult lessThanOrEqualTo(
AttributeValue value)
{
OrderingMatchingRule matchingRule = attributeType
.getOrderingMatchingRule();
if (matchingRule == null)
{
return ConditionResult.UNDEFINED;
}
ByteString normalizedValue;
try
{
normalizedValue =
matchingRule.normalizeValue(value.getValue());
}
catch (Exception e)
{
if (debugEnabled())
{
TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
// We couldn't normalize the provided value. We should return
// "undefined".
return ConditionResult.UNDEFINED;
}
ConditionResult result = ConditionResult.FALSE;
for (AttributeValue v : values)
{
try
{
ByteString nv = matchingRule.normalizeValue(v.getValue());
int comparisonResult = matchingRule
.compareValues(nv, normalizedValue);
if (comparisonResult <= 0)
{
return ConditionResult.TRUE;
}