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:
-
GemFireCache
RegionService
PdxInstance
PdxInstanceFactory
- Builder Software Design Pattern
-
Nested Class Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
PdxInstanceBuilder
(org.apache.geode.cache.RegionService regionService) Constructs a new instance ofPdxInstanceBuilder
initialized with the requiredRegionService
. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.geode.pdx.PdxInstanceFactory
copy
(org.apache.geode.pdx.PdxInstance pdxInstance) Copies the contents of the existingPdxInstance
to a newPdxInstance
built with this Builder.static PdxInstanceBuilder
create()
Factory method used to construct a new instance of thePdxInstanceBuilder
class.static PdxInstanceBuilder
create
(org.apache.geode.cache.RegionService regionService) Factory method use to construct a new instance of thePdxInstanceBuilder
class initialized with the given, requiredRegionService
used by the Builder to performs its functions.Constructs a newPdxInstance
from the given, required sourceObject
.protected org.apache.geode.cache.RegionService
Returns a reference to the configuredRegionService
used to perform the operations of this PDX Builder.
-
Constructor Details
-
PdxInstanceBuilder
protected PdxInstanceBuilder(org.apache.geode.cache.RegionService regionService) Constructs a new instance ofPdxInstanceBuilder
initialized with the requiredRegionService
.- Parameters:
regionService
-RegionService
instance used to perform the functions of the PDX Builder.- Throws:
IllegalArgumentException
- ifRegionService
is null.- See Also:
-
RegionService
-
-
Method Details
-
create
Factory method used to construct a new instance of thePdxInstanceBuilder
class. This factory method tries to resolve theGemFireCache
instance for the caller by usingSimpleCacheResolver
. Alternatively, callers may provider their ownGemFireCache
instance by callingcreate(RegionService)
.- Returns:
- a new instance of the
PdxInstanceBuilder
. - Throws:
IllegalArgumentException
- if aGemFireCache
instance is not present.- See Also:
-
create
Factory method use to construct a new instance of thePdxInstanceBuilder
class initialized with the given, requiredRegionService
used by the Builder to performs its functions.- Parameters:
regionService
-RegionService
instance used by thePdxInstanceBuilder
to perform its functions; must not be null.- Returns:
- an new instance of the
PdxInstanceBuilder
. - Throws:
IllegalArgumentException
- ifGemFireCache
is null.- See Also:
-
GemFireCache
PdxInstanceBuilder(RegionService)
-
getRegionService
protected org.apache.geode.cache.RegionService getRegionService()Returns a reference to the configuredRegionService
used 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 existingPdxInstance
to a newPdxInstance
built with this Builder.- Parameters:
pdxInstance
-PdxInstance
to copy.- Returns:
- an instance of the
PdxInstanceFactory
used tocreate
thePdxInstance
. - Throws:
IllegalArgumentException
- ifPdxInstance
is null.- See Also:
-
PdxInstance
PdxInstanceFactory
-
from
Constructs a newPdxInstance
from the given, required sourceObject
.- Parameters:
source
-Object
being serialized to PDX; must not be null.- Returns:
- a
PdxInstanceBuilder.Factory
used to create thePdxInstance
from the given, required sourceObject
, which was serialized to PDX. - Throws:
IllegalArgumentException
- ifsource
is null.- See Also:
-