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 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)
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 VirtualEntry
public SpaceDocument setTypeName(String typeName)
setTypeName
in interface VirtualEntry
typeName
- Type name to set.public boolean containsProperty(String name)
containsProperty
in interface VirtualEntry
name
- Name of property to look for.public <T> T getProperty(String name)
getProperty
in interface VirtualEntry
name
- Name of property.public SpaceDocument setProperty(String name, Object value)
setProperty
in interface VirtualEntry
name
- Name of propertyvalue
- New value of property.public <T> T removeProperty(String name)
removeProperty
in interface VirtualEntry
name
- Name of property to remove.public Map<String,Object> getProperties()
getProperties
in interface VirtualEntry
public SpaceDocument addProperties(Map<String,Object> properties)
addProperties
in interface VirtualEntry
properties
- Properties to add.public int getVersion()
getVersion
in interface VirtualEntry
public SpaceDocument setVersion(int version)
setVersion
in interface VirtualEntry
public boolean isTransient()
isTransient
in interface VirtualEntry
public SpaceDocument setTransient(boolean isTransient)
setTransient
in interface 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.