org.openstreetmap.osmosis.core.domain.v0_6
Class EntityBuilder<T extends Entity>

java.lang.Object
  extended by org.openstreetmap.osmosis.core.domain.v0_6.EntityBuilder<T>
Type Parameters:
T - The type of entity to be built.
All Implemented Interfaces:
Storeable
Direct Known Subclasses:
NodeBuilder, RelationBuilder, WayBuilder

Deprecated. Builder classes are not required because entities are now writeable.

@Deprecated
public abstract class EntityBuilder<T extends Entity>
extends java.lang.Object
implements Storeable

Provides facilities to specify the contents of entity and create new instances. Entities themselves are immutable to support concurrent access, this class provides a means of manipulating them.

Author:
Brett Henderson

Field Summary
protected  int changesetId
          Deprecated. The entity changeset identifier.
protected  long id
          Deprecated. The unique entity identifier.
protected  java.util.Collection<Tag> tags
          Deprecated. The tags describing the entity.
protected  TimestampContainer timestampContainer
          Deprecated. The entity timestamp container.
protected  OsmUser user
          Deprecated. The user who created the entity.
protected  int version
          Deprecated. The current entity version.
 
Constructor Summary
EntityBuilder()
          Deprecated. Creates a new instance.
EntityBuilder(Entity entity)
          Deprecated. Creates a new instance.
EntityBuilder(long id, int version, java.util.Date timestamp, OsmUser user, long changesetId)
          Deprecated. Creates a new instance.
EntityBuilder(long id, int version, TimestampContainer timestampContainer, OsmUser user, long changesetId)
          Deprecated. Creates a new instance.
 
Method Summary
 EntityBuilder<T> addTag(Tag tag)
          Deprecated. Adds a new tag.
abstract  T buildEntity()
          Deprecated. Builds a new entity instance based on the current data.
 EntityBuilder<T> clearTags()
          Deprecated. Remove all existing tags.
 long getChangesetId()
          Deprecated. Gets the id of the changeset that this version of the entity was created by.
 long getId()
          Deprecated. Gets the current id value.
 java.util.Collection<Tag> getTags()
          Deprecated. Obtains the tags.
 java.util.Date getTimestamp()
          Deprecated. Gets the current timestamp value.
 TimestampContainer getTimestampContainer()
          Deprecated. Gets the current timestamp value.
 OsmUser getUser()
          Deprecated. Gets the current user value.
 int getVersion()
          Deprecated. Gets the current version value.
protected  EntityBuilder<T> initialize(Entity entity)
          Deprecated. Initializes the contents of the builder to the specified data.
protected  EntityBuilder<T> initialize(long newId, int newVersion, java.util.Date newTimestamp, OsmUser newUser, long newChangesetId)
          Deprecated. Initializes the contents of the builder to the specified data.
protected  EntityBuilder<T> initialize(long newId, int newVersion, TimestampContainer newTimestampContainer, OsmUser newUser, long newChangesetId)
          Deprecated. Initializes the contents of the builder to the specified data.
 EntityBuilder<T> setChangesetId(long newChangesetId)
          Deprecated. Sets the id of the changeset that this version of the entity was created by.
 EntityBuilder<T> setId(long newId)
          Deprecated. Sets a new id value.
 EntityBuilder<T> setTags(java.util.Collection<Tag> newTags)
          Deprecated. Sets a new tags value.
 EntityBuilder<T> setTimestamp(java.util.Date timestamp)
          Deprecated. Sets a new timestamp value.
 EntityBuilder<T> setTimestamp(TimestampContainer newTimestampContainer)
          Deprecated. Sets a new timestamp value.
 EntityBuilder<T> setUser(OsmUser newUser)
          Deprecated. Sets a new user value.
 EntityBuilder<T> setVersion(int newVersion)
          Deprecated. Sets a new version value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openstreetmap.osmosis.core.store.Storeable
store
 

Field Detail

id

protected long id
Deprecated. 
The unique entity identifier.


version

protected int version
Deprecated. 
The current entity version.


timestampContainer

protected TimestampContainer timestampContainer
Deprecated. 
The entity timestamp container.


user

protected OsmUser user
Deprecated. 
The user who created the entity.


changesetId

protected int changesetId
Deprecated. 
The entity changeset identifier.


tags

protected java.util.Collection<Tag> tags
Deprecated. 
The tags describing the entity.

Constructor Detail

EntityBuilder

public EntityBuilder()
Deprecated. 
Creates a new instance.


EntityBuilder

public EntityBuilder(Entity entity)
Deprecated. 
Creates a new instance.

Parameters:
entity - The entity to initialise to.

EntityBuilder

public EntityBuilder(long id,
                     int version,
                     java.util.Date timestamp,
                     OsmUser user,
                     long changesetId)
Deprecated. 
Creates a new instance.

Parameters:
id - The unique identifier.
version - The version of the entity.
timestamp - The last updated timestamp.
user - The user that last modified this entity.
changesetId - The id of the changeset that this version of the entity was created by.

EntityBuilder

public EntityBuilder(long id,
                     int version,
                     TimestampContainer timestampContainer,
                     OsmUser user,
                     long changesetId)
Deprecated. 
Creates a new instance.

Parameters:
id - The unique identifier.
version - The version of the entity.
timestampContainer - The container holding the timestamp in an alternative timestamp representation.
user - The user that last modified this entity.
changesetId - The id of the changeset that this version of the entity was created by.
Method Detail

initialize

protected EntityBuilder<T> initialize(Entity entity)
Deprecated. 
Initializes the contents of the builder to the specified data.

Parameters:
entity - The entity to initialise to.
Returns:
This object allowing method chaining.

initialize

protected EntityBuilder<T> initialize(long newId,
                                      int newVersion,
                                      java.util.Date newTimestamp,
                                      OsmUser newUser,
                                      long newChangesetId)
Deprecated. 
Initializes the contents of the builder to the specified data.

Parameters:
newId - The unique identifier.
newVersion - The version of the entity.
newTimestamp - The last updated timestamp.
newUser - The user that last modified this entity.
newChangesetId - The id of the changeset that this version of the entity was created by.
Returns:
This object allowing method chaining.

initialize

protected EntityBuilder<T> initialize(long newId,
                                      int newVersion,
                                      TimestampContainer newTimestampContainer,
                                      OsmUser newUser,
                                      long newChangesetId)
Deprecated. 
Initializes the contents of the builder to the specified data.

Parameters:
newId - The unique identifier.
newVersion - The version of the entity.
newTimestampContainer - The container holding the timestamp in an alternative timestamp representation.
newUser - The user that last modified this entity.
newChangesetId - The id of the changeset that this version of the entity was created by.
Returns:
This object allowing method chaining.

setId

public EntityBuilder<T> setId(long newId)
Deprecated. 
Sets a new id value.

Parameters:
newId - The new id.
Returns:
This object allowing method chaining.

getId

public long getId()
Deprecated. 
Gets the current id value.

Returns:
The id.

setVersion

public EntityBuilder<T> setVersion(int newVersion)
Deprecated. 
Sets a new version value.

Parameters:
newVersion - The new version.
Returns:
This object allowing method chaining.

getVersion

public int getVersion()
Deprecated. 
Gets the current version value.

Returns:
The id.

setTimestamp

public EntityBuilder<T> setTimestamp(java.util.Date timestamp)
Deprecated. 
Sets a new timestamp value.

Parameters:
timestamp - The new timestamp.
Returns:
This object allowing method chaining.

getTimestamp

public java.util.Date getTimestamp()
Deprecated. 
Gets the current timestamp value.

Returns:
The timestamp.

setTimestamp

public EntityBuilder<T> setTimestamp(TimestampContainer newTimestampContainer)
Deprecated. 
Sets a new timestamp value.

Parameters:
newTimestampContainer - The timestamp wrapped within a container.
Returns:
This object allowing method chaining.

getTimestampContainer

public TimestampContainer getTimestampContainer()
Deprecated. 
Gets the current timestamp value.

Returns:
The timestamp container holding the current timestamp.

setUser

public EntityBuilder<T> setUser(OsmUser newUser)
Deprecated. 
Sets a new user value.

Parameters:
newUser - The new user.
Returns:
This object allowing method chaining.

getUser

public OsmUser getUser()
Deprecated. 
Gets the current user value.

Returns:
The user.

getChangesetId

public long getChangesetId()
Deprecated. 
Gets the id of the changeset that this version of the entity was created by.

Returns:
The changeset id.

setChangesetId

public EntityBuilder<T> setChangesetId(long newChangesetId)
Deprecated. 
Sets the id of the changeset that this version of the entity was created by.

Parameters:
newChangesetId - The changeset id.
Returns:
This object allowing method chaining.

getTags

public java.util.Collection<Tag> getTags()
Deprecated. 
Obtains the tags.

Returns:
The tags.

clearTags

public EntityBuilder<T> clearTags()
Deprecated. 
Remove all existing tags.

Returns:
This object allowing method chaining.

setTags

public EntityBuilder<T> setTags(java.util.Collection<Tag> newTags)
Deprecated. 
Sets a new tags value.

Parameters:
newTags - The new tags.
Returns:
This object allowing method chaining.

addTag

public EntityBuilder<T> addTag(Tag tag)
Deprecated. 
Adds a new tag.

Parameters:
tag - The new tag.
Returns:
This object allowing method chaining.

buildEntity

public abstract T buildEntity()
Deprecated. 
Builds a new entity instance based on the current data.

Returns:
The new entity instance.