Class GuavaSerIteratorFactory

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static SerIterator biMap​(com.google.common.collect.BiMap<?,​?> map, java.lang.Class<?> declaredType, java.lang.Class<?> keyType, java.lang.Class<?> valueType, java.util.List<java.lang.Class<?>> valueTypeTypes)
      Gets an iterator wrapper for BiMap.
      static SerIterable biMap​(java.lang.Class<?> keyType, java.lang.Class<?> valueType, java.util.List<java.lang.Class<?>> valueTypeTypes)
      Gets an iterable wrapper for BiMap.
      SerIterator create​(java.lang.Object value, MetaProperty<?> prop, java.lang.Class<?> beanClass)
      Creates an iterator wrapper for a meta-property value.
      SerIterator createChild​(java.lang.Object value, SerIterator parent)
      Creates an iterator wrapper for a value retrieved from a parent iterator.
      SerIterable createIterable​(java.lang.String metaTypeDescription, JodaBeanSer settings, java.util.Map<java.lang.String,​java.lang.Class<?>> knownTypes)
      Creates an iterator wrapper for a meta-property value.
      SerIterable createIterable​(MetaProperty<?> prop, java.lang.Class<?> beanClass)
      Creates an iterator wrapper for a meta-property value.
      static SerIterable immutableList​(java.lang.Class<?> valueType, java.util.List<java.lang.Class<?>> valueTypeTypes)
      Gets an iterable wrapper for ImmutableList.
      static SerIterable immutableSet​(java.lang.Class<?> valueType, java.util.List<java.lang.Class<?>> valueTypeTypes)
      Gets an iterable wrapper for ImmutableSet.
      static SerIterable immutableSortedSet​(java.lang.Class<?> valueType, java.util.List<java.lang.Class<?>> valueTypeTypes)
      Gets an iterable wrapper for ImmutableSortedSet.
      static SerIterable listMultimap​(java.lang.Class<?> keyType, java.lang.Class<?> valueType, java.util.List<java.lang.Class<?>> valueTypeTypes)
      Gets an iterable wrapper for ListMultimap.
      static SerIterator multimap​(com.google.common.collect.Multimap<?,​?> map, java.lang.Class<?> declaredType, java.lang.Class<?> keyType, java.lang.Class<?> valueType, java.util.List<java.lang.Class<?>> valueTypeTypes)
      Gets an iterator wrapper for Multimap.
      static SerIterator multiset​(com.google.common.collect.Multiset<?> multiset, java.lang.Class<?> declaredType, java.lang.Class<?> valueType, java.util.List<java.lang.Class<?>> valueTypeTypes)
      Gets an iterator wrapper for Multiset.
      static SerIterable multiset​(java.lang.Class<?> valueType, java.util.List<java.lang.Class<?>> valueTypeTypes)
      Gets an iterable wrapper for Multiset.
      static SerIterable setMultimap​(java.lang.Class<?> keyType, java.lang.Class<?> valueType, java.util.List<java.lang.Class<?>> valueTypeTypes)
      Gets an iterable wrapper for SetMultimap.
      static SerIterable sortedMultiset​(java.lang.Class<?> valueType, java.util.List<java.lang.Class<?>> valueTypeTypes)
      Gets an iterable wrapper for SortedMultiset.
      static SerIterator table​(com.google.common.collect.Table<?,​?,​?> table, java.lang.Class<?> declaredType, java.lang.Class<?> rowType, java.lang.Class<?> colType, java.lang.Class<?> valueType, java.util.List<java.lang.Class<?>> valueTypeTypes)
      Gets an iterator wrapper for Table.
      static SerIterable table​(java.lang.Class<?> rowType, java.lang.Class<?> colType, java.lang.Class<?> valueType, java.util.List<java.lang.Class<?>> valueTypeTypes)
      Gets an iterable wrapper for Table.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GuavaSerIteratorFactory

        public GuavaSerIteratorFactory()
    • Method Detail

      • create

        public SerIterator create​(java.lang.Object value,
                                  MetaProperty<?> prop,
                                  java.lang.Class<?> beanClass)
        Creates an iterator wrapper for a meta-property value.
        Overrides:
        create in class SerIteratorFactory
        Parameters:
        value - the possible collection-like object, not null
        prop - the meta-property defining the value, not null
        beanClass - the class of the bean, not the meta-property, for better generics, not null
        Returns:
        the iterator, null if not a collection-like type
      • createChild

        public SerIterator createChild​(java.lang.Object value,
                                       SerIterator parent)
        Creates an iterator wrapper for a value retrieved from a parent iterator.

        Allows the parent iterator to define the child iterator using generic type information. This handles cases such as a List as the value in a Map.

        Overrides:
        createChild in class SerIteratorFactory
        Parameters:
        value - the possible collection-like object, not null
        parent - the parent iterator, not null
        Returns:
        the iterator, null if not a collection-like type
      • createIterable

        public SerIterable createIterable​(java.lang.String metaTypeDescription,
                                          JodaBeanSer settings,
                                          java.util.Map<java.lang.String,​java.lang.Class<?>> knownTypes)
        Creates an iterator wrapper for a meta-property value.
        Overrides:
        createIterable in class SerIteratorFactory
        Parameters:
        metaTypeDescription - the description of the collection type, not null
        settings - the settings object, not null
        knownTypes - the known types map, null if not using known type shortening
        Returns:
        the iterator, null if not a collection-like type
      • createIterable

        public SerIterable createIterable​(MetaProperty<?> prop,
                                          java.lang.Class<?> beanClass)
        Creates an iterator wrapper for a meta-property value.
        Overrides:
        createIterable in class SerIteratorFactory
        Parameters:
        prop - the meta-property defining the value, not null
        beanClass - the class of the bean, not the meta-property, for better generics, not null
        Returns:
        the iterator, null if not a collection-like type
      • biMap

        public static final SerIterable biMap​(java.lang.Class<?> keyType,
                                              java.lang.Class<?> valueType,
                                              java.util.List<java.lang.Class<?>> valueTypeTypes)
        Gets an iterable wrapper for BiMap.
        Parameters:
        keyType - the value type, not null
        valueType - the value type, not null
        valueTypeTypes - the generic parameters of the value type
        Returns:
        the iterable, not null
      • multiset

        public static final SerIterable multiset​(java.lang.Class<?> valueType,
                                                 java.util.List<java.lang.Class<?>> valueTypeTypes)
        Gets an iterable wrapper for Multiset.
        Parameters:
        valueType - the value type, not null
        valueTypeTypes - the generic parameters of the value type
        Returns:
        the iterable, not null
      • sortedMultiset

        public static final SerIterable sortedMultiset​(java.lang.Class<?> valueType,
                                                       java.util.List<java.lang.Class<?>> valueTypeTypes)
        Gets an iterable wrapper for SortedMultiset.
        Parameters:
        valueType - the value type, not null
        valueTypeTypes - the generic parameters of the value type
        Returns:
        the iterable, not null
      • multiset

        public static final SerIterator multiset​(com.google.common.collect.Multiset<?> multiset,
                                                 java.lang.Class<?> declaredType,
                                                 java.lang.Class<?> valueType,
                                                 java.util.List<java.lang.Class<?>> valueTypeTypes)
        Gets an iterator wrapper for Multiset.
        Parameters:
        multiset - the collection, not null
        declaredType - the declared type, not null
        valueType - the value type, not null
        valueTypeTypes - the generic parameters of the value type
        Returns:
        the iterator, not null
      • listMultimap

        public static final SerIterable listMultimap​(java.lang.Class<?> keyType,
                                                     java.lang.Class<?> valueType,
                                                     java.util.List<java.lang.Class<?>> valueTypeTypes)
        Gets an iterable wrapper for ListMultimap.
        Parameters:
        keyType - the key type, not null
        valueType - the value type, not null
        valueTypeTypes - the generic parameters of the value type
        Returns:
        the iterable, not null
      • setMultimap

        public static final SerIterable setMultimap​(java.lang.Class<?> keyType,
                                                    java.lang.Class<?> valueType,
                                                    java.util.List<java.lang.Class<?>> valueTypeTypes)
        Gets an iterable wrapper for SetMultimap.
        Parameters:
        keyType - the key type, not null
        valueType - the value type, not null
        valueTypeTypes - the generic parameters of the value type
        Returns:
        the iterable, not null
      • multimap

        public static final SerIterator multimap​(com.google.common.collect.Multimap<?,​?> map,
                                                 java.lang.Class<?> declaredType,
                                                 java.lang.Class<?> keyType,
                                                 java.lang.Class<?> valueType,
                                                 java.util.List<java.lang.Class<?>> valueTypeTypes)
        Gets an iterator wrapper for Multimap.
        Parameters:
        map - the collection, not null
        declaredType - the declared type, not null
        keyType - the key type, not null
        valueType - the value type, not null
        valueTypeTypes - the generic parameters of the value type
        Returns:
        the iterator, not null
      • table

        public static final SerIterable table​(java.lang.Class<?> rowType,
                                              java.lang.Class<?> colType,
                                              java.lang.Class<?> valueType,
                                              java.util.List<java.lang.Class<?>> valueTypeTypes)
        Gets an iterable wrapper for Table.
        Parameters:
        rowType - the row type, not null
        colType - the column type, not null
        valueType - the value type, not null
        valueTypeTypes - the generic parameters of the value type
        Returns:
        the iterable, not null
      • table

        public static final SerIterator table​(com.google.common.collect.Table<?,​?,​?> table,
                                              java.lang.Class<?> declaredType,
                                              java.lang.Class<?> rowType,
                                              java.lang.Class<?> colType,
                                              java.lang.Class<?> valueType,
                                              java.util.List<java.lang.Class<?>> valueTypeTypes)
        Gets an iterator wrapper for Table.
        Parameters:
        table - the collection, not null
        declaredType - the declared type, not null
        rowType - the row type, not null
        colType - the col type, not null
        valueType - the value type, not null
        valueTypeTypes - the generic parameters of the value type
        Returns:
        the iterator, not null
      • biMap

        public static final SerIterator biMap​(com.google.common.collect.BiMap<?,​?> map,
                                              java.lang.Class<?> declaredType,
                                              java.lang.Class<?> keyType,
                                              java.lang.Class<?> valueType,
                                              java.util.List<java.lang.Class<?>> valueTypeTypes)
        Gets an iterator wrapper for BiMap.
        Parameters:
        map - the collection, not null
        declaredType - the declared type, not null
        keyType - the value type, not null
        valueType - the value type, not null
        valueTypeTypes - the generic parameters of the value type
        Returns:
        the iterator, not null
      • immutableList

        public static final SerIterable immutableList​(java.lang.Class<?> valueType,
                                                      java.util.List<java.lang.Class<?>> valueTypeTypes)
        Gets an iterable wrapper for ImmutableList.
        Parameters:
        valueType - the value type, not null
        valueTypeTypes - the generic parameters of the value type
        Returns:
        the iterable, not null
      • immutableSortedSet

        public static final SerIterable immutableSortedSet​(java.lang.Class<?> valueType,
                                                           java.util.List<java.lang.Class<?>> valueTypeTypes)
        Gets an iterable wrapper for ImmutableSortedSet.
        Parameters:
        valueType - the value type, not null
        valueTypeTypes - the generic parameters of the value type
        Returns:
        the iterable, not null
      • immutableSet

        public static final SerIterable immutableSet​(java.lang.Class<?> valueType,
                                                     java.util.List<java.lang.Class<?>> valueTypeTypes)
        Gets an iterable wrapper for ImmutableSet.
        Parameters:
        valueType - the value type, not null
        valueTypeTypes - the generic parameters of the value type
        Returns:
        the iterable, not null