Package io.sundr.model.utils
Class Collections
- java.lang.Object
-
- io.sundr.model.utils.Collections
-
public class Collections extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static io.sundr.model.TypeDefARRAY_LISTstatic TypeCastAS_COLLECTIONstatic TypeCastAS_MAPstatic io.sundr.model.TypeDefCOLLECTIONstatic io.sundr.model.ClassRefCOLLECTION_REFstatic io.sundr.model.TypeParamDefEstatic io.sundr.model.TypeDefHASH_MAPstatic Function<io.sundr.model.TypeRef,Boolean>IS_COLLECTIONstatic Function<io.sundr.model.TypeRef,Boolean>IS_LISTstatic Function<io.sundr.model.TypeRef,Boolean>IS_MAPstatic Function<io.sundr.model.TypeRef,Boolean>IS_SETstatic io.sundr.model.TypeDefITERABLEstatic io.sundr.model.TypeDefITERATORstatic io.sundr.model.TypeParamDefKstatic io.sundr.model.TypeDefLINKED_HASH_MAPstatic io.sundr.model.TypeDefLINKED_HASH_SETstatic io.sundr.model.TypeDefLISTstatic io.sundr.model.TypeDefMAPstatic io.sundr.model.TypeDefMAP_ENTRYstatic io.sundr.model.ClassRefMAP_REFstatic io.sundr.model.TypeDefSETstatic io.sundr.model.TypeParamDefV
-
Constructor Summary
Constructors Constructor Description Collections()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Optional<io.sundr.model.TypeRef>getCollectionElementType(io.sundr.model.TypeRef type)If the supplied type implementsCollection(directly or indirectly), determine its generic element type.static Optional<io.sundr.model.TypeRef>getMapKeyType(io.sundr.model.TypeRef mapType)If the supplied type implementsMap(directly or indirectly), determine its generic key type.static Optional<io.sundr.model.TypeRef>getMapValueType(io.sundr.model.TypeRef mapType)If the supplied type implementsMap(directly or indirectly), determine its generic value type.static booleanisCollection(io.sundr.model.TypeRef type)Checks if aTypeRefis aCollection.
-
-
-
Field Detail
-
E
public static final io.sundr.model.TypeParamDef E
-
K
public static final io.sundr.model.TypeParamDef K
-
V
public static final io.sundr.model.TypeParamDef V
-
ITERABLE
public static final io.sundr.model.TypeDef ITERABLE
-
ITERATOR
public static final io.sundr.model.TypeDef ITERATOR
-
COLLECTION
public static final io.sundr.model.TypeDef COLLECTION
-
COLLECTION_REF
public static final io.sundr.model.ClassRef COLLECTION_REF
-
MAP
public static final io.sundr.model.TypeDef MAP
-
MAP_REF
public static final io.sundr.model.ClassRef MAP_REF
-
MAP_ENTRY
public static final io.sundr.model.TypeDef MAP_ENTRY
-
HASH_MAP
public static final io.sundr.model.TypeDef HASH_MAP
-
LINKED_HASH_MAP
public static final io.sundr.model.TypeDef LINKED_HASH_MAP
-
LIST
public static final io.sundr.model.TypeDef LIST
-
ARRAY_LIST
public static final io.sundr.model.TypeDef ARRAY_LIST
-
SET
public static final io.sundr.model.TypeDef SET
-
LINKED_HASH_SET
public static final io.sundr.model.TypeDef LINKED_HASH_SET
-
AS_MAP
public static final TypeCast AS_MAP
-
AS_COLLECTION
public static final TypeCast AS_COLLECTION
-
-
Method Detail
-
getCollectionElementType
public static Optional<io.sundr.model.TypeRef> getCollectionElementType(io.sundr.model.TypeRef type)
If the supplied type implementsCollection(directly or indirectly), determine its generic element type. Otherwise, returnOptional.empty()
-
getMapKeyType
public static Optional<io.sundr.model.TypeRef> getMapKeyType(io.sundr.model.TypeRef mapType)
If the supplied type implementsMap(directly or indirectly), determine its generic key type. Otherwise, returnOptional.empty()
-
getMapValueType
public static Optional<io.sundr.model.TypeRef> getMapValueType(io.sundr.model.TypeRef mapType)
If the supplied type implementsMap(directly or indirectly), determine its generic value type. Otherwise, returnOptional.empty()
-
isCollection
public static boolean isCollection(io.sundr.model.TypeRef type)
Checks if aTypeRefis aCollection.- Parameters:
type- The type to check.- Returns:
- True if its a Collection.
-
-