org.joda.beans.ser
Class GuavaSerIteratorFactory

java.lang.Object
  extended by org.joda.beans.ser.SerIteratorFactory
      extended by org.joda.beans.ser.GuavaSerIteratorFactory

public class GuavaSerIteratorFactory
extends SerIteratorFactory

Guava factory used to create wrappers around collection-like objects.


Field Summary
 
Fields inherited from class org.joda.beans.ser.SerIteratorFactory
EMPTY_VALUE_TYPES, INSTANCE
 
Constructor Summary
GuavaSerIteratorFactory()
           
 
Method Summary
 SerIterator create(Object value, List<Class<?>> types)
          Creates an iterator wrapper for an arbitrary value.
 SerIterator create(Object value, MetaProperty<?> prop, Class<?> beanClass)
          Creates an iterator wrapper for a meta-property value.
 SerIterable createIterable(MetaProperty<?> prop, Class<?> beanClass)
          Creates an iterator wrapper for a meta-property value.
 SerIterable createIterable(String metaTypeDescription, JodaBeanSer settings, Map<String,Class<?>> knownTypes)
          Creates an iterator wrapper for a meta-property value.
static SerIterable listMultimap(Class<?> keyType, Class<?> valueType, List<Class<?>> valueTypeTypes)
          Gets an iterable wrapper for ListMultimap.
static SerIterator multimap(com.google.common.collect.Multimap<?,?> map, Class<?> keyType, Class<?> valueType, List<Class<?>> valueTypeTypes)
          Gets an iterator wrapper for Multimap.
static SerIterable multiset(Class<?> valueType, List<Class<?>> valueTypeTypes)
          Gets an iterable wrapper for Multiset.
static SerIterator multiset(com.google.common.collect.Multiset<?> multiset, Class<?> valueType, List<Class<?>> valueTypeTypes)
          Gets an iterator wrapper for Multiset.
static SerIterable setMultimap(Class<?> keyType, Class<?> valueType, List<Class<?>> valueTypeTypes)
          Gets an iterable wrapper for SetMultimap.
static SerIterable sortedMultiset(Class<?> valueType, List<Class<?>> valueTypeTypes)
          Gets an iterable wrapper for SortedMultiset.
 
Methods inherited from class org.joda.beans.ser.SerIteratorFactory
array, array, collection, create, createIterable, list, map, map, navigableMap, navigableSet, set, sortedMap, sortedSet
 
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(Object value,
                          List<Class<?>> types)
Creates an iterator wrapper for an arbitrary value.

Overrides:
create in class SerIteratorFactory
Parameters:
value - the possible collection-like object, not null
types - the generic type parameters to use, empty if unknown
Returns:
the iterator, null if not a collection-like type

create

public SerIterator create(Object value,
                          MetaProperty<?> prop,
                          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

createIterable

public SerIterable createIterable(String metaTypeDescription,
                                  JodaBeanSer settings,
                                  Map<String,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,
                                  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

multiset

public static final SerIterable multiset(Class<?> valueType,
                                         List<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(Class<?> valueType,
                                               List<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,
                                         Class<?> valueType,
                                         List<Class<?>> valueTypeTypes)
Gets an iterator wrapper for Multiset.

Parameters:
multiset - the collection, 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(Class<?> keyType,
                                             Class<?> valueType,
                                             List<Class<?>> valueTypeTypes)
Gets an iterable wrapper for ListMultimap.

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

setMultimap

public static final SerIterable setMultimap(Class<?> keyType,
                                            Class<?> valueType,
                                            List<Class<?>> valueTypeTypes)
Gets an iterable wrapper for SetMultimap.

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

multimap

public static final SerIterator multimap(com.google.common.collect.Multimap<?,?> map,
                                         Class<?> keyType,
                                         Class<?> valueType,
                                         List<Class<?>> valueTypeTypes)
Gets an iterator wrapper for Multimap.

Parameters:
map - the collection, 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


Copyright © 2007–2013 Joda.org. All rights reserved.