| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package com.sun.opends.sdk.util; |
| | |
| | | } |
| | | }; |
| | | |
| | | private static final Function<Object, Object, Void> IDENTITY = |
| | | new Function<Object, Object, Void>() |
| | | { |
| | | |
| | | public Object apply(Object value, Void p) |
| | | { |
| | | return value; |
| | | } |
| | | |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | /** |
| | | * Returns a function which always returns the value that it was provided |
| | | * with. |
| | | * |
| | | * @param <M> |
| | | * The type of values transformed by this function. |
| | | * @return A function which always returns the value that it was provided |
| | | * with. |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public static <M> Function<M, M, Void> identityFunction() |
| | | { |
| | | return (Function<M, M, Void>) IDENTITY; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Returns a function which converts a {@code String} to lower case using |
| | | * {@link StaticUtils#toLowerCase} and then trims it. |
| | | * |