Gets a mapper which applies {@code function} to each element.

@param function
@return
173225
public static <A, B> Mapper<A, B> fromFunction(final Function<A, B> function) {
    return new Mapper<A, B>() {
      @Override
      public B map(A item) {
        return function.apply(item);
      }
    };
  }
789115
@Override
    public Object map(Object sourceEnumerable, Function mapFunction, boolean filterNulls) {
        Validate.argumentIsNotNull(mapFunction);

        Multimap sourceMultimap = toNotNullMultimap(sourceEnumerable);
        Multimap targetMultimap = ArrayListMultimap.create();

        MapType.mapEntrySet(sourceMultimap.entries(), mapFunction, (k,v) -> targetMultimap.put(k,v), filterNulls);

        return targetMultimap;
    }
552229
@Override
    public <B> ListT<W,B> map(final Function<? super T, ? extends B> f) {
        return of(run.map(o -> o.map(f)));
    }
571324
public FluentMatchingR<T, R> get(Function2<A, B, R> function) {
    return get(fluentMatchingR, function);
  }
1128948
public final <R> R map(Function5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> function) {
        return function.apply(v1, v2, v3, v4, v5);
    }
85931
public Stream map(MapFunction function) {
        projectionValidation(getOutputFields());
        return _topology.addSourcedNode(this,
                                        new ProcessorNode(
                                                _topology.getUniqueStreamId(),
                                                _name,
                                                getOutputFields(),
                                                getOutputFields(),
                                                new MapProcessor(getOutputFields(), new MapFunctionExecutor(function))));
    }
258919
public <U> CoreRemoteMongoIterable<U> map(final Function<ResultT, U> mapper) {
    return new CoreRemoteMappingIterable<>(this, mapper);
  }
996751
public <R> SparkStream<R> mapPartitions(@NonNull SerializableFunction<Iterator<? super T>, ? extends R> function) {
      return new SparkStream<>(rdd.mapPartitions(iterator -> {
         Configurator.INSTANCE.configure(configBroadcast.value());
         return Cast.as(function.apply(iterator));
      }));
   }
836822
public <NV> Graph<K, NV, EV> mapVertices(final MapFunction<Vertex<K, VV>, NV> mapper, TypeInformation<Vertex<K, NV>> returnType) {
		DataSet<Vertex<K, NV>> mappedVertices = vertices.map(
				new MapFunction<Vertex<K, VV>, Vertex<K, NV>>() {
					private Vertex<K, NV> output = new Vertex<>();

					public Vertex<K, NV> map(Vertex<K, VV> value) throws Exception {
						output.f0 = value.f0;
						output.f1 = mapper.map(value);
						return output;
					}
				})
				.returns(returnType)
				.withForwardedFields("f0")
					.name("Map vertices");

		return new Graph<>(mappedVertices, this.edges, this.context);
	}
509084
public <O> int foreach(Function<? super T, O> function) {
        int count = 0;
        for (T item : each()) {
        	function.apply(item);
            ++count;
		}
        
        return count;
    }
1097179
public <R> Stream<R> map(Function<? super T, ? extends R> mapper) {
        List<R> list = new ArrayList<R>();
        while (iterator.hasNext()) {
            list.add(mapper.apply(iterator.next()));
        }
        return Stream.of(list);
    }
312720
public static Expression getByName(final String function) {
    final Expression expression = available_functions.get(function);
    if (expression == null) {
      throw new UnsupportedOperationException("Function " + function 
          + " has not been implemented");
    }
    return expression;
  }
882765
public <T> Observable<T> execute(ResultSetMapper<? extends T> function) {
        return bufferedParameters(this)
                // execute once per set of parameters
                .concatMap(executeOnce(function));
    }
694525
public static <T, U> Collector<T, ?, Seq<T>> modeAllBy(Function<? super T, ? extends U> function) {
        return Collector.of(
            () -> new LinkedHashMap<U, List<T>>(),
            (m, t) -> m.compute(function.apply(t), (k, l) -> {
                List<T> result = l != null ? l : new ArrayList<>();
                result.add(t);
                return result;
            }),
            (m1, m2) -> {
                for (Entry<U, List<T>> e : m2.entrySet()) {
                    List<T> l = m1.get(e.getKey());

                    if (l == null)
                        m1.put(e.getKey(), e.getValue());
                    else
                        l.addAll(e.getValue());
                }

                return m1;
            },
            m -> Seq.seq(m).maxAllBy(t -> t.v2.size()).flatMap(t -> Seq.seq(t.v2))
        );
    }
771158
public <K> Multimap<K,T> groupBy(Function<? super T, K> function) {
        return Multimaps.index(each(), function);
    }
358331
public void mapFunction(String prefix, String function, Method meth) {
        getELContext().getFunctionMapper().mapFunction(prefix, function, meth);
    }
1104301
public final <U1> Tuple4<U1, T2, T3, T4> map1(Function<? super T1, ? extends U1> function) {
        return Tuple.tuple(function.apply(v1), v2, v3, v4);
    }