public class SpaceDocument extends Object implements 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 Form| Constructor 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)
Adds the specified properties to the document's current properties.
|
boolean |
containsProperty(String name)
Returns true if this document contains the specified property.
|
boolean |
equals(Object obj) |
Map<String,Object> |
getProperties()
Returns an unmodifiable view of the document's properties.
|
<T> T |
getProperty(String name)
Gets a property's value by its name.
|
String |
getTypeName() |
int |
getVersion()
Returns the entry's version.
|
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)
Removes the property from the document (if it exists).
|
SpaceDocument |
setProperty(String name,
Object value)
Sets a property's value by its name.
|
SpaceDocument |
setTransient(boolean isTransient)
Sets whether or not the entry is transient.
|
SpaceDocument |
setTypeName(String typeName)
Sets the document type name.
|
SpaceDocument |
setVersion(int version)
Sets the entry's 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 VirtualEntrypublic SpaceDocument setTypeName(String typeName)
setTypeName in interface VirtualEntrytypeName - Type name to set.public boolean containsProperty(String name)
containsProperty in interface VirtualEntryname - Name of property to look for.public <T> T getProperty(String name)
getProperty in interface VirtualEntryname - Name of property.public SpaceDocument setProperty(String name, Object value)
setProperty in interface VirtualEntryname - Name of propertyvalue - New value of property.public <T> T removeProperty(String name)
removeProperty in interface VirtualEntryname - Name of property to remove.public Map<String,Object> getProperties()
getProperties in interface VirtualEntrypublic SpaceDocument addProperties(Map<String,Object> properties)
addProperties in interface VirtualEntryproperties - Properties to add.public int getVersion()
getVersion in interface VirtualEntrypublic SpaceDocument setVersion(int version)
setVersion in interface VirtualEntrypublic boolean isTransient()
isTransient in interface VirtualEntrypublic SpaceDocument setTransient(boolean isTransient)
setTransient in interface VirtualEntrypublic void writeExternal(ObjectOutput out) throws IOException
Externalizable interface and should not be called
directly.writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
Externalizable interface and should not be called
directly.readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void readExternalV1(ObjectInput in) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic void initFromDocument(SpaceDocument document)
Copyright © GigaSpaces.