org.entityfs.util
Class EntityRenameSpecification

java.lang.Object
  extended by org.entityfs.util.EntityRenameSpecification

public final class EntityRenameSpecification
extends Object

This specification is used together with the Entities.rename(org.entityfs.EntityView, org.entityfs.EntityAcceptingEntityView, EntityRenameSpecification) . It contains settings for a move or rename operation.

The default setting of the overwrite strategy property is to use the DontOverwriteAndThrowException strategy.

The setter methods of this object returns the object instance, so setter calls can be chained together.

Since:
1.1
Author:
Karl Gustafsson

Constructor Summary
EntityRenameSpecification()
           
 
Method Summary
 String getName()
          Get the name that the entity will have at the target location.
 OverwriteStrategy getOverwriteStrategy()
          Get the strategy used for dealing with an old entity that already exists at the target location.
 EntityRenameSpecification setName(String name)
          Set the name that the entity will have at the target location.
 EntityRenameSpecification setOverwriteStrategy(OverwriteStrategy overwriteStrategy)
          Set a new overwrite strategy that says how the rename operation should behave if there already is an entity at the target location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityRenameSpecification

public EntityRenameSpecification()
Method Detail

getName

public String getName()
Get the name that the entity will have at the target location. If this is not set (null), the entity's old name will be preserved.

By default, the value of this property is null.

Returns:
The new name of the entity or null if the old entity name should be preserved.

setName

public EntityRenameSpecification setName(String name)
Set the name that the entity will have at the target location. If this is not set (null), the entity's old name will be preserved.

By default, the value of this property is null.

Parameters:
name - The entity's new name or null if the name should be preserved.

getOverwriteStrategy

public OverwriteStrategy getOverwriteStrategy()
Get the strategy used for dealing with an old entity that already exists at the target location.

Non-empty directories are never overwritten.

The default value of this property is DontOverwriteAndThrowException.

Returns:
The overwrite strategy.

setOverwriteStrategy

public EntityRenameSpecification setOverwriteStrategy(OverwriteStrategy overwriteStrategy)
Set a new overwrite strategy that says how the rename operation should behave if there already is an entity at the target location.

Non-empty directories are never overwritten.

The default value of this property is DontOverwriteAndThrowException.

Parameters:
overwriteStrategy - The overwrite strategy.