@Override Collection<V> createValues() { return Collections2.transform(set, function); }
/** * Get aggregation distinct column indexes. * * @return aggregation distinct column indexes */ public Collection<Integer> getAggregationDistinctColumnIndexes() { return Collections2.transform(columnMetaDataList, new Function<AggregationDistinctColumnMetaData, Integer>() { @Override public Integer apply(final AggregationDistinctColumnMetaData input) { return input.columnIndex; } }); }
/** * Get aggregation distinct column labels. * * @return aggregation distinct column labels */ public Collection<String> getAggregationDistinctColumnLabels() { return Collections2.transform(columnMetaDataList, new Function<AggregationDistinctColumnMetaData, String>() { @Override public String apply(final AggregationDistinctColumnMetaData input) { return input.columnLabel; } }); }
@Override Collection<V> createValues() { return Collections2.transform(set, function); }
@Override public Collection<DruidServer> getInventory() { // Returning a lazy collection, because currently getInventory() is always used for one-time iteration. It's OK for // storing in a field and repetitive iteration as well, because the lambda is very cheap - just a final field // access. return Collections2.transform(servers.values(), serverHolder -> serverHolder.druidServer); }
private static ImmutableList<ImmutableWorkerInfo> getImmutableWorkerFromZK(Collection<ZkWorker> workers) { return ImmutableList.copyOf(Collections2.transform(workers, ZkWorker::toImmutable)); }
private static ImmutableList<Worker> getWorkerFromZK(Collection<ZkWorker> workers) { return ImmutableList.copyOf(Collections2.transform(workers, ZkWorker::getWorker)); }
@Override Collection<V2> createValues() { return Collections2.transform( fromMultimap.entries(), Maps.<K, V1, V2>asEntryToValueFunction(transformer)); } }
Collection<V2> transform(K key, Collection<V1> values) { Function<? super V1, V2> function = Maps.asValueToValueFunction(transformer, key); if (values instanceof List) { return Lists.transform((List<V1>) values, function); } else { return Collections2.transform(values, function); } }
@Override Collection<V2> createValues() { return Collections2.transform(fromTable.values(), function); }
@Override public Collection<PreparedStatement> getRoutedStatements() { return Collections2.transform(preparedStatementExecutor.getStatements(), new Function<Statement, PreparedStatement>() { @Override public PreparedStatement apply(final Statement input) { return (PreparedStatement) input; } }); } }
@Override public Collection<Permission> resolvePermissionsInRole(String roleId) { final Set<String> permissions = resolveStringPermission(roleId); // copy to avoid reiterating all the time return Sets.newHashSet(Collections2.transform(permissions, new Function<String, Permission>() { @Nullable @Override public Permission apply(@Nullable String input) { return new WildcardPermission(input); } })); }
@Override public Collection<String> create(String[] elements) { List<String> list = newArrayList(); for (String element : elements) { list.add((element == null) ? null : "q" + element); } return Collections2.transform(list, REMOVE_FIRST_CHAR); } })
@Nonnull @SuppressWarnings("unchecked") @Override public Set<String> getRoleIds() { final List<ObjectId> roles = firstNonNull((List<ObjectId>) fields.get(ROLES), Collections.<ObjectId>emptyList()); return new HashSet<>(Collections2.transform(roles, new ObjectIdStringFunction())); }
public Collection<Server> getAll() { try { return Collections2.transform(serviceProvider.getAllInstances(), TO_SERVER); } catch (Exception e) { log.info(e, "Unable to get all instances"); return Collections.emptyList(); } }
public Collection<HostAndPort> discoverNodesInTier(String tier) { Preconditions.checkState(lifecycleLock.awaitStarted(5, TimeUnit.SECONDS), "not started"); return Collections2.transform( lookupNodeDiscovery.getNodesInTier(tier), new Function<HostAndPortWithScheme, HostAndPort>() { @Override public HostAndPort apply(HostAndPortWithScheme input) { return input.getHostAndPort(); } } ); }
@Override public Set<String> getAdditionalDefaultGroups() { final Set<String> additionalGroups = getAdditionalDefaultGroupIds(); try { final Map<String, Role> idToRole = roleService.loadAllIdMap(); return Sets.newHashSet(Collections2.transform(additionalGroups, Roles.roleIdToNameFunction(idToRole))); } catch (NotFoundException e) { LOG.error("Unable to load role mapping"); return Collections.emptySet(); } }
private Collection<Object> getNodes(NodeType nodeType, boolean full) { Collection<DiscoveryDruidNode> discoveryDruidNodes = druidNodeDiscoveryProvider.getForNodeType(nodeType) .getAllNodes(); if (full) { return (Collection) discoveryDruidNodes; } else { return Collections2.transform( discoveryDruidNodes, (discoveryDruidNode) -> Node.from(discoveryDruidNode.getDruidNode()) ); } }
public boolean reverify(Unifier unifier) { return MoreObjects.firstNonNull( new PlaceholderVerificationVisitor( Collections2.transform( placeholder().requiredParameters(), Functions.forMap(arguments())), arguments().values()) .scan(unifier.getBinding(placeholder().exprKey()), unifier), true); }