java.lang.Object
org.springframework.data.gemfire.mapping.Regions
All Implemented Interfaces:
Iterable<org.apache.geode.cache.Region<?,?>>

public class Regions extends Object implements Iterable<org.apache.geode.cache.Region<?,?>>
Simple value object to abstract access to Regions by name and mapped type.
See Also:
  • Constructor Details

    • Regions

      public Regions(@NonNull Iterable<org.apache.geode.cache.Region<?,?>> regions, @NonNull org.springframework.data.mapping.context.MappingContext<? extends GemfirePersistentEntity<?>,?> mappingContext)
      Constructs a new instance of the Regions wrapper for the given Regions and MappingContext.
      Parameters:
      regions - Iterable of cache Regions; must not be null.
      mappingContext - Spring Data MappingContext used for data mapping; must not be null.
      See Also:
  • Method Details

    • getRegion

      public <T> org.apache.geode.cache.Region<?,T> getRegion(Class<T> entityType)
      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.
      Type Parameters:
      T - the Region value class type.
      Parameters:
      entityType - must not be null.
      Returns:
      the Region the given type is mapped to.
    • getRegion

      public <S, T> org.apache.geode.cache.Region<S,T> getRegion(String namePath)
      Returns the Region with the given name or path.
      Type Parameters:
      S - the Region key class type.
      T - the Region value class type.
      Parameters:
      namePath - must not be null, and either identifies the Region by name or the fully-qualified path.
      Returns:
      the Region with the given name or path.
    • iterator

      public Iterator<org.apache.geode.cache.Region<?,?>> iterator()
      Specified by:
      iterator in interface Iterable<org.apache.geode.cache.Region<?,?>>