public class ChangeSet
extends java.lang.Object
Constructor and Description |
---|
ChangeSet()
Create an empty ChangeSet.
|
ChangeSet(ChangeSet other)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAll(java.util.Collection<? extends Entity> c)
Add all defined properties from a collection.
|
void |
addChange(EntityID e,
java.lang.String urn,
Property p)
Add a change.
|
void |
addChange(Entity e,
Property p)
Add a change.
|
void |
debug()
Write this changeset to Logger.debug in a readable form.
|
void |
entityDeleted(EntityID e)
Register a deleted entity.
|
java.util.Set<EntityID> |
getChangedEntities()
Get the IDs of all changed entities.
|
java.util.Set<Property> |
getChangedProperties(EntityID e)
Get the properties that have changed for an entity.
|
Property |
getChangedProperty(EntityID e,
java.lang.String urn)
Look up a property change for an entity by property URN.
|
java.util.Set<EntityID> |
getDeletedEntities()
Get the IDs of all deleted entities.
|
java.lang.String |
getEntityURN(EntityID id)
Get the URN of a changed entity.
|
void |
merge(ChangeSet other)
Merge another ChangeSet into this one.
|
void |
read(java.io.InputStream in)
Read this ChangeSet from a stream.
|
java.lang.String |
toString() |
void |
write(java.io.OutputStream out)
Write this ChangeSet to a stream.
|
public ChangeSet()
public ChangeSet(ChangeSet other)
other
- The ChangeSet to copy.public void addChange(Entity e, Property p)
e
- The entity that has changed.p
- The property that has changed.public void addChange(EntityID e, java.lang.String urn, Property p)
e
- The ID of the entity that has changed.urn
- The URN of the entity that has changed.p
- The property that has changed.public void entityDeleted(EntityID e)
e
- The ID of the entity that has been deleted.public java.util.Set<Property> getChangedProperties(EntityID e)
e
- The entity ID to look up.public Property getChangedProperty(EntityID e, java.lang.String urn)
e
- The entity ID to look up.urn
- The property URN to look up.public java.util.Set<EntityID> getChangedEntities()
public java.util.Set<EntityID> getDeletedEntities()
public java.lang.String getEntityURN(EntityID id)
id
- The ID of the entity.public void merge(ChangeSet other)
other
- The other ChangeSet.public void addAll(java.util.Collection<? extends Entity> c)
c
- The collection to copy changes from.public void write(java.io.OutputStream out) throws java.io.IOException
out
- The stream to write to.java.io.IOException
- If there is a problem.public void read(java.io.InputStream in) throws java.io.IOException
in
- The stream to read from.java.io.IOException
- If there is a problem.public java.lang.String toString()
toString
in class java.lang.Object
public void debug()