Class Collections

java.lang.Object
io.sundr.model.utils.Collections

public class Collections extends Object
  • Field Details

  • Constructor Details

    • Collections

      public Collections()
  • Method Details

    • getCollectionElementType

      public static Optional<TypeRef> getCollectionElementType(TypeRef type)
      If the supplied type implements Collection (directly or indirectly), determine its generic element type. Otherwise, return Optional.empty()
    • getMapKeyType

      public static Optional<TypeRef> getMapKeyType(TypeRef mapType)
      If the supplied type implements Map (directly or indirectly), determine its generic key type. Otherwise, return Optional.empty()
    • getMapValueType

      public static Optional<TypeRef> getMapValueType(TypeRef mapType)
      If the supplied type implements Map (directly or indirectly), determine its generic value type. Otherwise, return Optional.empty()
    • isCollection

      public static boolean isCollection(TypeRef type)
      Checks if a TypeRef is a Collection.
      Parameters:
      type - The type to check.
      Returns:
      True if its a Collection.