org.springframework.data.gemfire.mapping
Class Regions

java.lang.Object
  extended by org.springframework.data.gemfire.mapping.Regions
All Implemented Interfaces:
Iterable<com.gemstone.gemfire.cache.Region<?,?>>

public class Regions
extends Object
implements Iterable<com.gemstone.gemfire.cache.Region<?,?>>

Simple value object to abstract access to regions by name and mapped type.


Constructor Summary
Regions(Iterable<com.gemstone.gemfire.cache.Region<?,?>> regions, org.springframework.data.mapping.context.MappingContext<? extends GemfirePersistentEntity<?>,?> context)
          Creates a new Regions wrapper for the given Regions and MappingContext.
 
Method Summary
<T> com.gemstone.gemfire.cache.Region<?,T>
getRegion(Class<T> type)
          Returns the Region the given type is mapped to.
<S,T> com.gemstone.gemfire.cache.Region<S,T>
getRegion(String name)
          Returns the Region with the given name.
 Iterator<com.gemstone.gemfire.cache.Region<?,?>> iterator()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Regions

public Regions(Iterable<com.gemstone.gemfire.cache.Region<?,?>> regions,
               org.springframework.data.mapping.context.MappingContext<? extends GemfirePersistentEntity<?>,?> context)
Creates a new Regions wrapper for the given Regions and MappingContext.

Parameters:
regions - must not be null.
context - must not be null.
Method Detail

getRegion

public <T> com.gemstone.gemfire.cache.Region<?,T> getRegion(Class<T> type)
Returns the Region the given type is mapped to. Will try to find a Region with the simple class name in case no mapping information is found.

Parameters:
type - must not be null.
Returns:
the Region the given type is mapped to.

getRegion

public <S,T> com.gemstone.gemfire.cache.Region<S,T> getRegion(String name)
Returns the Region with the given name.

Parameters:
name - must not be null.
Returns:
the Region with the given name.

iterator

public Iterator<com.gemstone.gemfire.cache.Region<?,?>> iterator()
Specified by:
iterator in interface Iterable<com.gemstone.gemfire.cache.Region<?,?>>