Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

233
Views
What is the equivalent way to do Ordering.lexicographical() in Java 8 Comparator?

Is there a way to implement Ordering.lexicographical() with Java 8 Comparator?

Comparator.thenCompare seems to be limited in this

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Seemingly not, no.

As a result, Guava still provides this functionality, but in the new class Comparators: https://guava.dev/releases/snapshot/api/docs/com/google/common/collect/Comparators.html#lexicographical(java.util.Comparator).

Note that Guava generally does a good job telling you whether and how to migrate off of it to new Java features, so you're often better off checking its Javadoc than digging on your own. In this case: https://guava.dev/releases/snapshot/api/docs/com/google/common/collect/Ordering.html#lexicographical().

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!