Skip to content

Commit

Permalink
MCCollections: Added collection mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
xDec0de committed Jul 13, 2024
1 parent 96a6ae5 commit ab127ea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/net/codersky/mcutils/java/MCCollections.java
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,12 @@ public static <S extends Collection<O>, T extends Collection<R>, O, R> T map(@No
return target;
}

// Mapping - Collection //

public static <S, R> Collection<R> map(@Nonnull Collection<S> collection, @Nonnull Function<S, R> mapper) {
return map(collection, new ArrayList<>(collection.size()), mapper);
}

// Mapping - Lists //

@Nonnull
Expand Down

0 comments on commit ab127ea

Please sign in to comment.