org.jboss.dna.graph.commands.basic
Class BasicCreateNodeCommand

java.lang.Object
  extended by org.jboss.dna.graph.commands.basic.BasicGraphCommand
      extended by org.jboss.dna.graph.commands.basic.BasicCreateNodeCommand
All Implemented Interfaces:
Comparable<CreateNodeCommand>, ActsAsUpdate, ActsOnPath, ActsOnProperties, CreateNodeCommand, GraphCommand

@NotThreadSafe
public class BasicCreateNodeCommand
extends BasicGraphCommand
implements CreateNodeCommand

Author:
Randall Hauch

Constructor Summary
BasicCreateNodeCommand(Path path)
           
BasicCreateNodeCommand(Path path, Collection<Property> properties, NodeConflictBehavior conflictBehavior)
           
 
Method Summary
 int compareTo(CreateNodeCommand that)
          
 boolean equals(Object obj)
          
 NodeConflictBehavior getConflictBehavior()
          Get the desired behavior when a node at the target path already exists.
 Path getPath()
          Get the path to which this command applies.
 Collection<Property> getProperties()
          Get the properties.
 int hashCode()
          
 void setProperties(Iterable<Property> properties)
           
 void setProperties(Property... properties)
           
 void setProperty(Property property)
           
 String toString()
          
 
Methods inherited from class org.jboss.dna.graph.commands.basic.BasicGraphCommand
getError, hasError, hasNoError, isCancelled, setCancelled, setError
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.dna.graph.commands.GraphCommand
getError, hasError, hasNoError, isCancelled, setError
 

Constructor Detail

BasicCreateNodeCommand

public BasicCreateNodeCommand(Path path)
Parameters:
path - the path to the node; may not be null

BasicCreateNodeCommand

public BasicCreateNodeCommand(Path path,
                              Collection<Property> properties,
                              NodeConflictBehavior conflictBehavior)
Parameters:
path - the path to the node; may not be null
properties - the properties of the node; may not be null
conflictBehavior - the desired behavior when a node exists at the path; may not be null
Method Detail

getPath

public Path getPath()
Get the path to which this command applies. If the path does not exist, an PathNotFoundException exception should be recorded as an error.

Specified by:
getPath in interface ActsOnPath
Returns:
the path; never null

getProperties

public Collection<Property> getProperties()
Get the properties. Any property with no values will be removed.

Specified by:
getProperties in interface ActsOnProperties
Specified by:
getProperties in interface CreateNodeCommand
Returns:
the properties

getConflictBehavior

public NodeConflictBehavior getConflictBehavior()
Get the desired behavior when a node at the target path already exists.

Specified by:
getConflictBehavior in interface CreateNodeCommand
Returns:
the desired behavior; never null

setProperty

public void setProperty(Property property)

setProperties

public void setProperties(Property... properties)

setProperties

public void setProperties(Iterable<Property> properties)

compareTo

public int compareTo(CreateNodeCommand that)

Specified by:
compareTo in interface Comparable<CreateNodeCommand>

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2008-Present JBoss a division of Red Hat. All Rights Reserved.