java.lang.Object
ushiosan.jvm.content.UPair<F,S>
- Type Parameters:
F- first element typeS- second element type
- Direct Known Subclasses:
UTrio
Immutable object used to represent elements with 2 values (element pair).
It is an alternative to "input" type objects because its value is read-only.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCopies the content of a map entry and converts it to aUPairobject.booleanIndicates whether some other object is "equal to" this one.extractPairs(@NotNull Map<T, K> map) Extracts all map entries and converts them toUPairobjects.extractPairs(@NotNull Properties properties) Extracts all-properties entries and converts them toUPairobjects.inthashCode()Returns a hash code value for the object.make(T first, K second) Shortcut pair instance
-
Field Details
-
first
First pair element -
second
Second pair element
-
-
Constructor Details
-
UPair
Default constructor- Parameters:
first- first elementsecond- second element
-
-
Method Details
-
make
@Contract(value="_, _ -> new", pure=true) @NotNull public static <T,K> @NotNull UPair<T,K> make(T first, K second) Shortcut pair instance- Type Parameters:
T- generic first typeK- generic second type- Parameters:
first- first valuesecond- second value- Returns:
- instance of
UPairclass
-
copyOf
@Contract("_ -> new") @NotNull public static <T,K> @NotNull UPair<T,K> copyOf(@NotNull Map.Entry<T, K> entry) Copies the content of a map entry and converts it to aUPairobject.- Type Parameters:
T- first element typeK- second element type- Parameters:
entry- the entry to copy- Returns:
- an instance of
UPairwith entry content
-
extractPairs
Extracts all map entries and converts them toUPairobjects.- Type Parameters:
T- first element typeK- second element type- Parameters:
map- the map to inspect- Returns:
- an array with all map pairs
-
extractPairs
public static UPair<String,String> @NotNull [] extractPairs(@NotNull @NotNull Properties properties) Extracts all-properties entries and converts them toUPairobjects.- Parameters:
properties- the properties to inspect- Returns:
- an array with all property pairs
-
hashCode
public int hashCode()Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided byHashMap. -
equals
Indicates whether some other object is "equal to" this one.
-