Package org.springframework.geode.pdx
Class PdxInstanceBuilder
java.lang.Object
org.springframework.geode.pdx.PdxInstanceBuilder
The
PdxInstanceBuilder class is a Builder
used to construct and initialize a PdxInstance from different sources.- Since:
- 1.3.0
- See Also:
-
GemFireCacheRegionServicePdxInstancePdxInstanceFactory- Builder Software Design Pattern
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPdxInstanceBuilder(org.apache.geode.cache.RegionService regionService) Constructs a new instance ofPdxInstanceBuilderinitialized with the requiredRegionService. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.geode.pdx.PdxInstanceFactorycopy(org.apache.geode.pdx.PdxInstance pdxInstance) Copies the contents of the existingPdxInstanceto a newPdxInstancebuilt with this Builder.static PdxInstanceBuildercreate()Factory method used to construct a new instance of thePdxInstanceBuilderclass.static PdxInstanceBuildercreate(org.apache.geode.cache.RegionService regionService) Factory method use to construct a new instance of thePdxInstanceBuilderclass initialized with the given, requiredRegionServiceused by the Builder to performs its functions.Constructs a newPdxInstancefrom the given, required sourceObject.protected org.apache.geode.cache.RegionServiceReturns a reference to the configuredRegionServiceused to perform the operations of this PDX Builder.
-
Constructor Details
-
PdxInstanceBuilder
protected PdxInstanceBuilder(org.apache.geode.cache.RegionService regionService) Constructs a new instance ofPdxInstanceBuilderinitialized with the requiredRegionService.- Parameters:
regionService-RegionServiceinstance used to perform the functions of the PDX Builder.- Throws:
IllegalArgumentException- ifRegionServiceis null.- See Also:
-
RegionService
-
-
Method Details
-
create
Factory method used to construct a new instance of thePdxInstanceBuilderclass. This factory method tries to resolve theGemFireCacheinstance for the caller by usingSimpleCacheResolver. Alternatively, callers may provider their ownGemFireCacheinstance by callingcreate(RegionService).- Returns:
- a new instance of the
PdxInstanceBuilder. - Throws:
IllegalArgumentException- if aGemFireCacheinstance is not present.- See Also:
-
create
Factory method use to construct a new instance of thePdxInstanceBuilderclass initialized with the given, requiredRegionServiceused by the Builder to performs its functions.- Parameters:
regionService-RegionServiceinstance used by thePdxInstanceBuilderto perform its functions; must not be null.- Returns:
- an new instance of the
PdxInstanceBuilder. - Throws:
IllegalArgumentException- ifGemFireCacheis null.- See Also:
-
GemFireCachePdxInstanceBuilder(RegionService)
-
getRegionService
protected org.apache.geode.cache.RegionService getRegionService()Returns a reference to the configuredRegionServiceused to perform the operations of this PDX Builder.- Returns:
- a reference to the configured
RegionService; never null.
-
copy
public org.apache.geode.pdx.PdxInstanceFactory copy(org.apache.geode.pdx.PdxInstance pdxInstance) Copies the contents of the existingPdxInstanceto a newPdxInstancebuilt with this Builder.- Parameters:
pdxInstance-PdxInstanceto copy.- Returns:
- an instance of the
PdxInstanceFactoryused tocreatethePdxInstance. - Throws:
IllegalArgumentException- ifPdxInstanceis null.- See Also:
-
PdxInstancePdxInstanceFactory
-
from
Constructs a newPdxInstancefrom the given, required sourceObject.- Parameters:
source-Objectbeing serialized to PDX; must not be null.- Returns:
- a
PdxInstanceBuilder.Factoryused to create thePdxInstancefrom the given, required sourceObject, which was serialized to PDX. - Throws:
IllegalArgumentException- ifsourceis null.- See Also:
-