Skip to content

Commit

Permalink
DocumentId.ofIntSet
Browse files Browse the repository at this point in the history
  • Loading branch information
teosarca committed May 3, 2017
1 parent 91437be commit c6e2dd3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/de/metas/ui/web/window/datatypes/DocumentId.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,18 @@ public static Set<DocumentId> ofStringSet(final Collection<String> documentIds)
.collect(GuavaCollectors.toImmutableSet());
}

public static Set<DocumentId> ofIntSet(final Collection<Integer> documentIds)
{
if (documentIds == null || documentIds.isEmpty())
{
return ImmutableSet.of();
}
return documentIds
.stream()
.map(idInt -> of(idInt))
.collect(GuavaCollectors.toImmutableSet());
}

public static final DocumentId fromNullable(final String idStr)
{
if (Check.isEmpty(idStr, true))
Expand Down

0 comments on commit c6e2dd3

Please sign in to comment.