|
GigaSpaces XAP 10.0.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.gigaspaces.document.SpaceDocument
public class SpaceDocument
Represents a document which can be stored and retrieved from the space.
A document is a collection of properties (which are name-value pairs) associated with a type.
A property name is a string. A property value can be of any type, but it is usually either a scalar
(e.g. int, String, Date, etc.), a set of properties (either 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 Summary | |
---|---|
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. |
Method Summary | ||
---|---|---|
SpaceDocument |
addProperties(Map<String,Object> properties)
|
|
boolean |
containsProperty(String name)
|
|
boolean |
equals(Object obj)
|
|
Map<String,Object> |
getProperties()
|
|
|
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)
|
|
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SpaceDocument()
public SpaceDocument(String typeName)
typeName
- Name of document's type.public SpaceDocument(String typeName, Map<String,Object> properties)
typeName
- Name of document's type.properties
- Properties to set in document.Method Detail |
---|
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 String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
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)
|
GigaSpaces XAP 10.0.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |