Class Types


  • public final class Types
    extends Object
    Helper class which contains convenience methods for creating types used to decode types.
    See Also:
    Decoder
    • Method Detail

      • collectionOf

        public static com.faunadb.client.types.Types.CollectionType collectionOf​(Class<? extends Collection> collectionType,
                                                                                 Type elementType)

        Creates a generic collection type representation

        
         Types.collectionOf(LinkedList.class, User.class)
         
        Parameters:
        collectionType - A concrete collection type
        elementType - An element type of the collection
        Returns:
        A type representing a collection
      • arrayListOf

        public static com.faunadb.client.types.Types.CollectionType arrayListOf​(Type elementType)

        Creates a collection type specialized for ArrayList

        
         Types.arrayListOf(User.class)
         Types.arrayListOf(String.class)
         Types.arrayListOf(int.class)
         
        Parameters:
        elementType - An element type of the collection
        Returns:
        A type representing an ArrayList
      • hashSetOf

        public static com.faunadb.client.types.Types.CollectionType hashSetOf​(Type elementType)

        Creates a collection type specialized for HashSet

        
         Types.hashSetOf(User.class)
         Types.hashSetOf(String.class)
         Types.hashSetOf(int.class)
         
        Parameters:
        elementType - An element type of the collection
        Returns:
        A type representing a HashSet
      • mapOf

        public static com.faunadb.client.types.Types.MapType mapOf​(Class<? extends Map> mapType,
                                                                   Type valueType)

        Creates a generic map type representation where the key is a string

        
         Types.mapOf(Hashtable.class, User.class)
         
        Parameters:
        mapType - A concrete map type
        valueType - The type of the value in the map
        Returns:
        A type representing a map
      • hashMapOf

        public static com.faunadb.client.types.Types.MapType hashMapOf​(Type valueType)

        Creates a map type specialized for HashMap

        
         Types.hashMapOf(User.class)
         
        Parameters:
        valueType - The type of the value in the map
        Returns:
        A type representing a HashMap