public class Collections extends Object
| Modifier and Type | Field and Description |
|---|---|
static TypeDef |
ARRAY_LIST |
static TypeCast |
AS_COLLECTION |
static TypeCast |
AS_MAP |
static TypeDef |
COLLECTION |
static ClassRef |
COLLECTION_REF |
static TypeParamDef |
E |
static TypeDef |
HASH_MAP |
static Function<TypeRef,Boolean> |
IS_COLLECTION |
static Function<TypeRef,Boolean> |
IS_LIST |
static Function<TypeRef,Boolean> |
IS_MAP |
static Function<TypeRef,Boolean> |
IS_SET |
static TypeDef |
ITERABLE |
static TypeDef |
ITERATOR |
static TypeParamDef |
K |
static TypeDef |
LINKED_HASH_MAP |
static TypeDef |
LINKED_HASH_SET |
static TypeDef |
LIST |
static TypeDef |
MAP |
static TypeDef |
MAP_ENTRY |
static ClassRef |
MAP_REF |
static TypeDef |
SET |
static TypeParamDef |
V |
| Constructor and Description |
|---|
Collections() |
| Modifier and Type | Method and Description |
|---|---|
static Optional<TypeRef> |
getCollectionElementType(TypeRef type)
If the supplied type implements
Collection (directly or indirectly), determine its generic element type. |
static Optional<TypeRef> |
getMapKeyType(TypeRef mapType)
If the supplied type implements
Map (directly or indirectly), determine its generic key type. |
static Optional<TypeRef> |
getMapValueType(TypeRef mapType)
If the supplied type implements
Map (directly or indirectly), determine its generic value type. |
static boolean |
isCollection(TypeRef type)
Checks if a
TypeRef is a Collection. |
public static final TypeParamDef E
public static final TypeParamDef K
public static final TypeParamDef V
public static final TypeDef ITERABLE
public static final TypeDef ITERATOR
public static final TypeDef COLLECTION
public static final ClassRef COLLECTION_REF
public static final TypeDef MAP
public static final ClassRef MAP_REF
public static final TypeDef MAP_ENTRY
public static final TypeDef HASH_MAP
public static final TypeDef LINKED_HASH_MAP
public static final TypeDef LIST
public static final TypeDef ARRAY_LIST
public static final TypeDef SET
public static final TypeDef LINKED_HASH_SET
public static final TypeCast AS_MAP
public static final TypeCast AS_COLLECTION
public static Optional<TypeRef> getCollectionElementType(TypeRef type)
Collection (directly or indirectly), determine its generic element type.
Otherwise, return Optional.empty()public static Optional<TypeRef> getMapKeyType(TypeRef mapType)
Map (directly or indirectly), determine its generic key type. Otherwise,
return Optional.empty()public static Optional<TypeRef> getMapValueType(TypeRef mapType)
Map (directly or indirectly), determine its generic value type.
Otherwise, return Optional.empty()public static boolean isCollection(TypeRef type)
TypeRef is a Collection.type - The type to check.Copyright © 2023. All rights reserved.