Class JavaUtilExtensions
- Namespace
- MASES.JNet.Specific.Extensions
- Assembly
- MASES.JNet.dll
Extension for Java.Util classes
public static class JavaUtilExtensions
- Inheritance
-
JavaUtilExtensions
- Inherited Members
Methods
ToJVMArray<TJVMType, TNetType>(TNetType[], Func<TNetType, TJVMType>)
Converts an IEnumerable<T> of string to an array of String
public static TJVMType[] ToJVMArray<TJVMType, TNetType>(this TNetType[] collection, Func<TNetType, TJVMType> func = null) where TJVMType : INativeConvertible<TJVMType, TNetType>, new()
Parameters
collection
TNetType[]The array of
TNetType
to be convertedfunc
Func<TNetType, TJVMType>An optional Func<T, TResult> used to return
TJVMType
from data ofTNetType
incollection
Returns
- TJVMType[]
The array of
TJVMType
Type Parameters
TJVMType
TNetType
ToJVMCollectionType<TIterableType, TJVMTypeInner, TNetType>(IEnumerable<TNetType>, Func<TNetType, TJVMTypeInner>)
Converts an IEnumerable<T> of TNetType
to an TIterableType
of TJVMTypeInner
public static TIterableType ToJVMCollectionType<TIterableType, TJVMTypeInner, TNetType>(this IEnumerable<TNetType> set, Func<TNetType, TJVMTypeInner> func = null) where TIterableType : Collection<TJVMTypeInner>, new() where TJVMTypeInner : INativeConvertible<TJVMTypeInner, TNetType>, new()
Parameters
set
IEnumerable<TNetType>The Collection<E> of
TJVMTypeInner
to be convertedfunc
Func<TNetType, TJVMTypeInner>An optional Func<T, TResult> used to return
TJVMTypeInner
from data ofTNetType
inset
Returns
- TIterableType
The converted
TIterableType
ofTJVMTypeInner
Type Parameters
TIterableType
A type implementing Iterable<T>
TJVMTypeInner
The expected JVM type
TNetType
The original .NET type
ToJVMCollection<TJVMType, TNetType>(IEnumerable<TNetType>, Func<TNetType, TJVMType>)
Converts an IEnumerable<T> of string to an Collection<E> of String
public static Collection<TJVMType> ToJVMCollection<TJVMType, TNetType>(this IEnumerable<TNetType> set, Func<TNetType, TJVMType> func = null) where TJVMType : INativeConvertible<TJVMType, TNetType>, new()
Parameters
set
IEnumerable<TNetType>The IEnumerable<T> of string to be converted
func
Func<TNetType, TJVMType>An optional Func<T, TResult> used to return
TJVMType
from data ofTNetType
inset
Returns
- Collection<TJVMType>
The converted Collection<E> of String
Type Parameters
TJVMType
TNetType
ToJVMDictionary<TJVMK, TJVMV, K, V>(IDictionary<K, V>, Func<K, TJVMK>, Func<V, TJVMV>)
Converts a IDictionary<TKey, TValue> to Dictionary<K, V>
public static Dictionary<TJVMK, TJVMV> ToJVMDictionary<TJVMK, TJVMV, K, V>(this IDictionary<K, V> dictionary, Func<K, TJVMK> keyConverter, Func<V, TJVMV> valueConverter)
Parameters
dictionary
IDictionary<K, V>keyConverter
Func<K, TJVMK>Converter from
K
toTJVMK
valueConverter
Func<V, TJVMV>Converter from
V
toTJVMV
Returns
- Dictionary<TJVMK, TJVMV>
The Dictionary<K, V>
Type Parameters
TJVMK
JVM key type
TJVMV
JVM value type
K
.NET Key type
V
.NET Value
ToJVMDictionary<TDictionaryType, TJVMK, TJVMV, K, V>(IDictionary<K, V>, Func<K, TJVMK>, Func<V, TJVMV>)
Converts a IDictionary<TKey, TValue> to TDictionaryType
public static TDictionaryType ToJVMDictionary<TDictionaryType, TJVMK, TJVMV, K, V>(this IDictionary<K, V> dictionary, Func<K, TJVMK> keyConverter = null, Func<V, TJVMV> valueConverter = null) where TDictionaryType : Dictionary<TJVMK, TJVMV>, new() where TJVMK : INativeConvertible<TJVMK, K> where TJVMV : INativeConvertible<TJVMV, V>
Parameters
dictionary
IDictionary<K, V>keyConverter
Func<K, TJVMK>Optional converter from
K
toTJVMK
valueConverter
Func<V, TJVMV>Optional converter from
V
toTJVMV
Returns
- TDictionaryType
The
TDictionaryType
Type Parameters
TDictionaryType
The Dictionary<K, V> over
TJVMK
andTJVMV
TJVMK
JVM key type
TJVMV
JVM value type
K
.NET Key type
V
.NET Value
ToJVMMap<TJVMK, TJVMV, K, V>(IDictionary<K, V>, Func<K, TJVMK>, Func<V, TJVMV>)
Converts a IDictionary<TKey, TValue> to Map<K, V>
public static Map<TJVMK, TJVMV> ToJVMMap<TJVMK, TJVMV, K, V>(this IDictionary<K, V> dictionary, Func<K, TJVMK> keyConverter, Func<V, TJVMV> valueConverter)
Parameters
dictionary
IDictionary<K, V>keyConverter
Func<K, TJVMK>Converter from
K
toTJVMK
valueConverter
Func<V, TJVMV>Converter from
V
toTJVMV
Returns
Type Parameters
TJVMK
JVM key type
TJVMV
JVM value type
K
.NET Key type
V
.NET Value
ToJVMMap<TMapType, TJVMK, TJVMV, K, V>(IDictionary<K, V>, Func<K, TJVMK>, Func<V, TJVMV>)
Converts a IDictionary<TKey, TValue> to TMapType
public static TMapType ToJVMMap<TMapType, TJVMK, TJVMV, K, V>(this IDictionary<K, V> dictionary, Func<K, TJVMK> keyConverter = null, Func<V, TJVMV> valueConverter = null) where TMapType : Map<TJVMK, TJVMV>, new() where TJVMK : INativeConvertible<TJVMK, K> where TJVMV : INativeConvertible<TJVMV, V>
Parameters
dictionary
IDictionary<K, V>keyConverter
Func<K, TJVMK>Optional converter from
K
toTJVMK
valueConverter
Func<V, TJVMV>Optional converter from
V
toTJVMV
Returns
- TMapType
The
TMapType
Type Parameters
TMapType
The Map<K, V> over
TJVMK
andTJVMV
TJVMK
JVM key type
TJVMV
JVM value type
K
.NET Key type
V
.NET Value
ToNetArray<TNetType, TJVMType>(IEnumerable<TJVMType>)
Converts an IEnumerable<T> of String to an array of string
public static TNetType[] ToNetArray<TNetType, TJVMType>(this IEnumerable<TJVMType> set) where TJVMType : INativeConvertible<TJVMType, TNetType>
Parameters
set
IEnumerable<TJVMType>The IEnumerable<T> of String to be converted
Returns
- TNetType[]
The converted array of string
Type Parameters
TNetType
TJVMType
ToNetCollectionType<TEnumerableType, TNetTypeInner, TJVMType>(IEnumerable<TJVMType>, Func<TJVMType, TNetTypeInner>)
Converts an IEnumerable<T> of TJVMType
to an TEnumerableType
of TNetTypeInner
public static TEnumerableType ToNetCollectionType<TEnumerableType, TNetTypeInner, TJVMType>(this IEnumerable<TJVMType> set, Func<TJVMType, TNetTypeInner> func = null) where TEnumerableType : ICollection<TNetTypeInner>, new() where TJVMType : INativeConvertible<TJVMType, TNetTypeInner>
Parameters
set
IEnumerable<TJVMType>The IEnumerable<T> of
TJVMType
to be convertedfunc
Func<TJVMType, TNetTypeInner>An Func<T, TResult> used to convert
TJVMType
intoTNetTypeInner
Returns
- TEnumerableType
The converted
TEnumerableType
ofTNetTypeInner
Type Parameters
TEnumerableType
A type implementing IEnumerable<T>
TNetTypeInner
The expected .NET type
TJVMType
The original JVM type
ToNetDictiony<K, V, TJVMK, TJVMV>(Map<TJVMK, TJVMV>, Func<TJVMK, K>, Func<TJVMV, V>)
Converts a IDictionary<TKey, TValue> to Map<K, V>
public static IDictionary<K, V> ToNetDictiony<K, V, TJVMK, TJVMV>(this Map<TJVMK, TJVMV> map, Func<TJVMK, K> keyConverter = null, Func<TJVMV, V> valueConverter = null) where TJVMK : INativeConvertible<TJVMK, K> where TJVMV : INativeConvertible<TJVMV, V>
Parameters
map
Map<TJVMK, TJVMV>The Map<K, V>
keyConverter
Func<TJVMK, K>Optional converter from
TJVMK
toK
valueConverter
Func<TJVMV, V>Optional converter from
TJVMV
toV
Returns
- IDictionary<K, V>
Type Parameters
K
.NET Key type
V
.NET Value
TJVMK
JVM key type
TJVMV
JVM value type
ToNetDictiony<TDictionaryType, K, V, TJVMK, TJVMV>(Map<TJVMK, TJVMV>, Func<TJVMK, K>, Func<TJVMV, V>)
Converts a IDictionary<TKey, TValue> to Map<K, V>
public static TDictionaryType ToNetDictiony<TDictionaryType, K, V, TJVMK, TJVMV>(this Map<TJVMK, TJVMV> map, Func<TJVMK, K> keyConverter = null, Func<TJVMV, V> valueConverter = null) where TDictionaryType : IDictionary<K, V>, new() where TJVMK : INativeConvertible<TJVMK, K> where TJVMV : INativeConvertible<TJVMV, V>
Parameters
map
Map<TJVMK, TJVMV>The Map<K, V>
keyConverter
Func<TJVMK, K>Optional converter from
TJVMK
toK
valueConverter
Func<TJVMV, V>Optional converter from
TJVMV
toV
Returns
- TDictionaryType
Type Parameters
TDictionaryType
The IDictionary<TKey, TValue> over
K
andV
K
.NET Key type
V
.NET Value
TJVMK
JVM key type
TJVMV
JVM value type