public class SpaceDocument extends Object implements com.gigaspaces.entry.VirtualEntry, Externalizable
Map
or
DocumentProperties
), or an array/collection or scalars or maps.
Documents of the same type can have different properties, which provides more dynamic schema than POJOs.DocumentProperties
,
SpaceTypeDescriptor
,
Serialized FormConstructor and Description |
---|
SpaceDocument()
Creates a space document of type java.lang.Object.
|
SpaceDocument(String typeName)
Creates a space document of the specified type.
|
SpaceDocument(String typeName,
Map<String,Object> properties)
Creates a space document of the specified type with the specified properties.
|
Modifier and Type | Method and Description |
---|---|
SpaceDocument |
addProperties(Map<String,Object> properties) |
boolean |
containsProperty(String name) |
boolean |
equals(Object obj) |
Map<String,Object> |
getProperties() |
<T> T |
getProperty(String name) |
String |
getTypeName() |
int |
getVersion() |
int |
hashCode() |
void |
initFromDocument(SpaceDocument document) |
protected void |
initialize() |
boolean |
isTransient() |
void |
readExternal(ObjectInput in)
This method is required by the
Externalizable interface and should not be called directly. |
void |
readExternalV1(ObjectInput in) |
<T> T |
removeProperty(String name) |
SpaceDocument |
setProperty(String name,
Object value) |
SpaceDocument |
setTransient(boolean isTransient) |
SpaceDocument |
setTypeName(String typeName) |
SpaceDocument |
setVersion(int version) |
String |
toString() |
void |
writeExternal(ObjectOutput out)
This method is required by the
Externalizable interface and should not be called directly. |
public SpaceDocument()
public SpaceDocument(String typeName)
typeName
- Name of document's type.protected void initialize()
public String getTypeName()
getTypeName
in interface com.gigaspaces.entry.VirtualEntry
public SpaceDocument setTypeName(String typeName)
setTypeName
in interface com.gigaspaces.entry.VirtualEntry
public boolean containsProperty(String name)
containsProperty
in interface com.gigaspaces.entry.VirtualEntry
public <T> T getProperty(String name)
getProperty
in interface com.gigaspaces.entry.VirtualEntry
public SpaceDocument setProperty(String name, Object value)
setProperty
in interface com.gigaspaces.entry.VirtualEntry
public <T> T removeProperty(String name)
removeProperty
in interface com.gigaspaces.entry.VirtualEntry
public Map<String,Object> getProperties()
getProperties
in interface com.gigaspaces.entry.VirtualEntry
public SpaceDocument addProperties(Map<String,Object> properties)
addProperties
in interface com.gigaspaces.entry.VirtualEntry
public int getVersion()
getVersion
in interface com.gigaspaces.entry.VirtualEntry
public SpaceDocument setVersion(int version)
setVersion
in interface com.gigaspaces.entry.VirtualEntry
public boolean isTransient()
isTransient
in interface com.gigaspaces.entry.VirtualEntry
public SpaceDocument setTransient(boolean isTransient)
setTransient
in interface com.gigaspaces.entry.VirtualEntry
public void writeExternal(ObjectOutput out) throws IOException
Externalizable
interface and should not be called directly.writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
Externalizable
interface and should not be called directly.readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void readExternalV1(ObjectInput in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public void initFromDocument(SpaceDocument document)
Copyright © GigaSpaces.