Top Description Fields Constructors Methods
org.jparsec.functors

public final Class Maps

extends Object
Class Inheritance
Imports
java.util.Locale, java.util.function.Function, .UnaryOperator

Provides common implementations of Map interface and the variants.
Author
Ben Yu

Field Summary

Modifier and TypeField and Description
public static final Function<String, Integer>
TO_INTEGER

Deprecated Use Integer::valueOf directly.
The Map that maps a String to Integer by calling Integer#valueOf(String).
public static UnaryOperator<String>
TO_LOWER_CASE

The UnaryOperator that maps a String to lower case using Locale#US.

public static UnaryOperator<String>
TO_UPPER_CASE

The UnaryOperator that maps a String to upper case using Locale#US.

Constructor Summary

AccessConstructor and Description
private
Maps()

Method Summary

Modifier and TypeMethod and Description
public static <F, T> Function<F, T>
constant(T v)
Deprecated Use from -> to directly.

Returns a Map that always maps any object to v.

public static <T> UnaryOperator<T>
identity()
Deprecated Use Function#identity instead.

Returns an identity map that maps parameter to itself.

public static <K, V> Function<K, V>
map(Map<K, V> m)
Deprecated Use Map::get instead.

Adapts a java.util.Map to Map.

public static <T> Map<T, String>
mapToString()
Deprecated Use String::valueOf directly.

public static <E extends Enum<E>> Function<String, E>
toEnum(Class<E> enumType)

Returns a Map that maps the string representation of an enum to the corresponding enum value by calling Enum#valueOf(Class, String).

public static UnaryOperator<String>
toLowerCase(final Locale locale)

Returns a UnaryOperator that maps a String to lower case using locale.

public static <A, B> Map2<A, B, Pair<A, B>>
toPair()
References Deprecated Map2 is deprecated or references (maybe indirectly) at least one deprecated element.

A Map2 object that maps 2 values into a Pair object.

public static <A, B, C> Map3<A, B, C, Tuple3<A, B, C>>
toTuple3()
Deprecated

A Map3 object that maps 3 values to a Tuple3 object.

public static <A, B, C, D> Map4<A, B, C, D, Tuple4<A, B, C, D>>
toTuple4()
Deprecated

A Map4 object that maps 4 values to a Tuple4 object.

public static <A, B, C, D, E> Map5<A, B, C, D, E, Tuple5<A, B, C, D, E>>
toTuple5()
Deprecated

A Map5 object that maps 5 values to a Tuple5 object.

public static UnaryOperator<String>
toUpperCase(Locale locale)

Returns a UnaryOperator that maps a String to upper case using locale.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

TO_INTEGERback to summary
public static final Function<String, Integer> TO_INTEGER

Deprecated

Use Integer::valueOf directly.

The Map that maps a String to Integer by calling Integer#valueOf(String).

Annotations
@Deprecated
TO_LOWER_CASEback to summary
public static UnaryOperator<String> TO_LOWER_CASE

The UnaryOperator that maps a String to lower case using Locale#US.

TO_UPPER_CASEback to summary
public static UnaryOperator<String> TO_UPPER_CASE

The UnaryOperator that maps a String to upper case using Locale#US.

Constructor Detail

Mapsback to summary
private Maps()

Method Detail

constantback to summary
public static <F, T> Function<F, T> constant(T v)

Deprecated

Use from -> to directly.

Returns a Map that always maps any object to v.

Annotations
@Deprecated
identityback to summary
public static <T> UnaryOperator<T> identity()

Deprecated

Use Function#identity instead.

Returns an identity map that maps parameter to itself.

Annotations
@Deprecated
mapback to summary
public static <K, V> Function<K, V> map(Map<K, V> m)

Deprecated

Use Map::get instead.

Adapts a java.util.Map to Map.

Annotations
@Deprecated
mapToStringback to summary
public static <T> Map<T, String> mapToString()

Deprecated

Use String::valueOf directly.

Annotations
@Deprecated
toEnumback to summary
public static <E extends Enum<E>> Function<String, E> toEnum(Class<E> enumType)

Returns a Map that maps the string representation of an enum to the corresponding enum value by calling Enum#valueOf(Class, String).

toLowerCaseback to summary
public static UnaryOperator<String> toLowerCase(final Locale locale)

Returns a UnaryOperator that maps a String to lower case using locale.

toPairback to summary
public static <A, B> Map2<A, B, Pair<A, B>> toPair()

References Deprecated

Map2 is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

A Map2 object that maps 2 values into a Pair object.

Annotations
@SuppressWarnings:unchecked
toTuple3back to summary
public static <A, B, C> Map3<A, B, C, Tuple3<A, B, C>> toTuple3()

Deprecated

A Map3 object that maps 3 values to a Tuple3 object.

Annotations
@Deprecated
@SuppressWarnings:unchecked
toTuple4back to summary
public static <A, B, C, D> Map4<A, B, C, D, Tuple4<A, B, C, D>> toTuple4()

Deprecated

A Map4 object that maps 4 values to a Tuple4 object.

Annotations
@Deprecated
@SuppressWarnings:unchecked
toTuple5back to summary
public static <A, B, C, D, E> Map5<A, B, C, D, E, Tuple5<A, B, C, D, E>> toTuple5()

Deprecated

A Map5 object that maps 5 values to a Tuple5 object.

Annotations
@SuppressWarnings:unchecked
@Deprecated
toUpperCaseback to summary
public static UnaryOperator<String> toUpperCase(Locale locale)

Returns a UnaryOperator that maps a String to upper case using locale.