Skip to content

Commit

Permalink
Update Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
victorsgDev authored Jan 17, 2023
1 parent 8d95822 commit 7a11e87
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@

Recibe dos argumentos y retorna un int.

- Método funcional:
- Método funcional:

int compare(T t1, T t2);
int compare(T t1, T t2);

- Métodos:
- Métodos:

static <T, U extends Comparable<? super U>> Comparator<T> comparing(Function<T, U> keyExtractor) {
Objects.requireNonNull(keyExtractor);
return (p1, p2) -> {
U u1 = keyExtractor.apply(p1);
U u2 = keyExtractor.apply(p2);
return u1.compareTo(u2);
};
}
static <T, U extends Comparable<? super U>> Comparator<T> comparing(Function<T, U> keyExtractor) {
Objects.requireNonNull(keyExtractor);
return (p1, p2) -> {
U u1 = keyExtractor.apply(p1);
U u2 = keyExtractor.apply(p2);
return u1.compareTo(u2);
};
}


0 comments on commit 7a11e87

Please sign in to comment.