org.joda.beans.ser
Interface SerIterable


public interface SerIterable

An abstraction over collections, lists, sets and maps.

This is a plugin point that can handle Guava collections.


Method Summary
 void add(Object key, Object value, int count)
          Adds an item to the builder.
 Object build()
          Builds the final collection.
 boolean isMapLike()
          Is the iterable map-like, as opposed to collection-like.
 SerIterator iterator()
          Obtains an iterator over the data.
 Class<?> keyType()
          Gets the type of the key.
 Class<?> valueType()
          Gets the type of the value.
 List<Class<?>> valueTypeTypes()
          Gets the generic parameters of the value type.
 

Method Detail

iterator

SerIterator iterator()
Obtains an iterator over the data.

Returns:
the iterator, not null

add

void add(Object key,
         Object value,
         int count)
Adds an item to the builder.

Parameters:
key - the key, such as for a map, null if no key
value - the value, such as for a map or list value, may be null
count - the count, such as for a multiset, typically one or greater

build

Object build()
Builds the final collection.

Returns:
the build collection, not null

isMapLike

boolean isMapLike()
Is the iterable map-like, as opposed to collection-like.

Returns:
true if map-like, false if collection-like

keyType

Class<?> keyType()
Gets the type of the key.

Returns:
the key type, null if no key

valueType

Class<?> valueType()
Gets the type of the value.

Returns:
the value type, not null

valueTypeTypes

List<Class<?>> valueTypeTypes()
Gets the generic parameters of the value type.

Returns:
the generic parameters of the value type, not null


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