Class DataDiff
java.lang.Object
org.tentackle.maven.plugin.wizard.pdodata.DataDiff
- All Implemented Interfaces:
DataNode
Datanode to be displayed in a tree table.
The node can be used in 2 modes:
The node can be used in 2 modes:
- to display the pdo tree
- to compare two pdo trees
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DataDiffcompare(DataObject left, DataObject right) Compares the data of a PDO between two locations.The optional comment.Gets the optional configuration path.getLeft()Gets the left data, null if no such data in left object.Gets the left value.getName()Returns the name of the node.
Can be the name of a property, an entity, class, interface, whatever.getNode()getNodes()Gets the subnodes.Gets the name of this node type.
Used to locate the image, for example.getRight()Gets the right data, null if no such data in right object.Gets the right value.getType()Returns the type of the node.
Can be any Java type, classname (w/o package) including optional generics.
Example:getValue()Returns the value of the node.
This is usually thetoStringvalue.booleanGets true if this node or a subnode differs.booleanReturns whether the left node is present.booleanReturns whether the right node is present.voidsetConfigurationPath(String configurationPath) Sets the optional configuration path.toString()
-
Constructor Details
-
DataDiff
Creates a DataDiff.- Parameters:
left- the left data, null if no such data in right objectright- the right data, null if no such data in right objectdifferent- true if this node or a sub node differsnodes- the sub nodes
-
-
Method Details
-
getLeft
Gets the left data, null if no such data in left object.- Returns:
- the left data, null if no such data in left object
-
getRight
Gets the right data, null if no such data in right object.- Returns:
- the right data, null if no such data in right object
-
isDifferent
public boolean isDifferent()Gets true if this node or a subnode differs.- Returns:
- true if this node or a subnode differs
-
getNodes
Gets the subnodes. -
getComment
Description copied from interface:DataNodeThe optional comment.- Specified by:
getCommentin interfaceDataNode- Returns:
- the comment, null if none
-
getType
Description copied from interface:DataNodeReturns the type of the node.
Can be any Java type, classname (w/o package) including optional generics.
Example:List<Message>
-
getName
Description copied from interface:DataNodeReturns the name of the node.
Can be the name of a property, an entity, class, interface, whatever. -
getValue
Description copied from interface:DataNodeReturns the value of the node.
This is usually thetoStringvalue. For collections, it's the size. -
toString
-
getNodeType
Description copied from interface:DataNodeGets the name of this node type.
Used to locate the image, for example.- Specified by:
getNodeTypein interfaceDataNode- Returns:
- the node type name
-
getNode
-
getLeftValue
Gets the left value.- Returns:
- null if none
-
getRightValue
Gets the right value.- Returns:
- null if none
-
isLeftPresent
public boolean isLeftPresent()Returns whether the left node is present.- Returns:
- true if left != null
-
isRightPresent
public boolean isRightPresent()Returns whether the right node is present.- Returns:
- true if right != null
-
setConfigurationPath
Description copied from interface:DataNodeSets the optional configuration path.- Specified by:
setConfigurationPathin interfaceDataNode- Parameters:
configurationPath- the path
-
getConfigurationPath
Description copied from interface:DataNodeGets the optional configuration path.- Specified by:
getConfigurationPathin interfaceDataNode- Returns:
- the path, null if none
-
compare
Compares the data of a PDO between two locations.- Parameters:
left- the data of the left location, must not be nullright- the data of the right location, null if just show the data and don't compare- Returns:
- the comparison
-