Sync with L2jServer HighFive Apr 21st 2015.

This commit is contained in:
MobiusDev
2015-04-22 09:59:28 +00:00
parent c896c6cd51
commit 1a6970e30d
37 changed files with 1518 additions and 1298 deletions

View File

@ -31,6 +31,8 @@ import java.time.temporal.TemporalAdjusters;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.logging.Logger;
/**
@ -223,4 +225,16 @@ public final class Util
.orElse(dateNowWithDifferentTime.with(TemporalAdjusters.next(daysOfWeek.get(0))));
// @formatter:on
}
/**
* This method translates map to function
* @param <K> key type of the map and argument of the function
* @param <V> value type of the map and return type of the function
* @param map the input map
* @return a function which returns map.get(arg)
*/
public static <K, V> Function<K, V> mapToFunction(Map<K, V> map)
{
return key -> map.get(key);
}
}