List of usage examples for com.google.common.collect ImmutableSet copyOf
public static <E> ImmutableSet<E> copyOf(Iterator<? extends E> elements)
From source file:org.apache.jackrabbit.oak.security.principal.CustomPrincipalProvider.java
CustomPrincipalProvider(String[] knownPrincipalNames) {
this.knownPrincipalNames = ImmutableSet.copyOf(knownPrincipalNames);
}
From source file:pl.nort.dayoneevernote.note.Note.java
public Note(String title, String body, DateTime creationTime, Optional<Coordinates> location, Set<String> labels) { this.title = checkNotNull(title); this.body = checkNotNull(body); this.creationTime = checkNotNull(creationTime); this.location = checkNotNull(location); this.labels = ImmutableSet.copyOf(checkNotNull(labels)); }
From source file:com.google.gerrit.server.account.ListGroupMembership.java
@Override public Set<AccountGroup.UUID> intersection(Iterable<AccountGroup.UUID> groupIds) { return Sets.intersection(ImmutableSet.copyOf(groupIds), groups); }
From source file:minium.web.internal.actions.DefaultOnExceptionInteractionListener.java
@SuppressWarnings("unchecked") public DefaultOnExceptionInteractionListener(Class<? extends Throwable>... exceptions) { this.exceptions = ImmutableSet.copyOf(exceptions); }
From source file:org.apache.abdera2.model.selector.LinkRelSelector.java
LinkRelSelector(String... rels) {
this.rels = ImmutableSet.copyOf(rels);
}
From source file:co.runrightfast.component.events.impl.ComponentEventFactoryImpl.java
@Override public ComponentEvent componentEvent(@NonNull final Event event, final String... tags) { final ComponentEventImpl.ComponentEventImplBuilder builder = ComponentEventImpl.builder() .componentId(componentId).event(event); if (ArrayUtils.isNotEmpty(tags)) { return builder.tags(Optional.of(ImmutableSet.copyOf(tags))).build(); }// w ww . j a va2 s. c om return builder.build(); }
From source file:org.apache.aurora.scheduler.http.TransformationUtils.java
/** * Gets an optional task metadata./* w ww . j a v a2s.c om*/ * * @param task Task to get metadata from. * @return Present if task metadata exists, absent otherwise. */ public static Optional<String> getMetadata(ITaskConfig task) { if (task.isSetMetadata()) { Iterable<String> metadata = ImmutableSet .copyOf(Iterables.transform(task.getMetadata(), TransformationUtils.METADATA_TOSTRING)); return Optional.of(Joiner.on(", ").join(Ordering.natural().sortedCopy(metadata))); } return Optional.absent(); }
From source file:org.onosproject.store.primitives.impl.StoragePartitionDetails.java
public StoragePartitionDetails(PartitionId partitionId, Collection<Member> activeMembers, Collection<Member> configuredMembers, Member leader, long leaderTerm) { this.partitionId = partitionId; this.activeMembers = ImmutableSet.copyOf(activeMembers); this.configuredMembers = ImmutableSet.copyOf(configuredMembers); this.leader = leader; this.leaderTerm = leaderTerm; }
From source file:io.airlift.discovery.InMemoryStaticStore.java
@Override public synchronized Set<Service> getAll() { return ImmutableSet.copyOf(services.values()); }