/** * Set the flag that determines sort order of case differences during tertiary level comparisons. * * @param caseFirst must not be {@literal null}. * @return */ public Collation caseFirst(CaseFirst sort) { ComparisonLevel strengthValue = strength.orElseGet(ComparisonLevel::tertiary); return strength(new ICUComparisonLevel(strengthValue.getLevel(), Optional.of(sort), strengthValue.getCaseLevel())); }
/** * Set whether to include {@code caseLevel} comparison. <br /> * * @param caseLevel * @return new {@link Collation}. */ public Collation caseLevel(boolean caseLevel) { ComparisonLevel strengthValue = strength.orElseGet(ComparisonLevel::primary); return strength( new ICUComparisonLevel(strengthValue.getLevel(), strengthValue.getCaseFirst(), Optional.of(caseLevel))); }
/** * Set the level of comparison to perform. * * @param strength * @return new {@link Collation}. */ public Collation strength(int strength) { ComparisonLevel current = this.strength.orElseGet(() -> new ICUComparisonLevel(strength)); return strength(new ICUComparisonLevel(strength, current.getCaseFirst(), current.getCaseLevel())); }
/** * Set whether to include {@code caseLevel} comparison. <br /> * * @param caseLevel * @return new {@link Collation}. */ public Collation caseLevel(boolean caseLevel) { ComparisonLevel strengthValue = strength.orElseGet(ComparisonLevel::primary); return strength( new ICUComparisonLevel(strengthValue.getLevel(), strengthValue.getCaseFirst(), Optional.of(caseLevel))); }
/** * Set the flag that determines sort order of case differences during tertiary level comparisons. * * @param caseFirst must not be {@literal null}. * @return */ public Collation caseFirst(CaseFirst sort) { ComparisonLevel strengthValue = strength.orElseGet(ComparisonLevel::tertiary); return strength(new ICUComparisonLevel(strengthValue.getLevel(), Optional.of(sort), strengthValue.getCaseLevel())); }
/** * Set the level of comparison to perform. * * @param strength * @return new {@link Collation}. */ public Collation strength(int strength) { ComparisonLevel current = this.strength.orElseGet(() -> new ICUComparisonLevel(strength)); return strength(new ICUComparisonLevel(strength, current.getCaseFirst(), current.getCaseLevel())); }