java.lang.Object
org.tentackle.maven.plugin.wizard.pdodata.DataDiff
All Implemented Interfaces:
DataNode

public class DataDiff extends Object implements DataNode
Datanode to be displayed in a tree table.
The node can be used in 2 modes:
  1. to display the pdo tree
  2. to compare two pdo trees
  • Constructor Details

    • DataDiff

      public DataDiff(DataNode left, DataNode right, boolean different, List<DataDiff> nodes)
      Creates a DataDiff.
      Parameters:
      left - the left data, null if no such data in right object
      right - the right data, null if no such data in right object
      different - true if this node or a sub node differs
      nodes - the sub nodes
  • Method Details

    • getLeft

      public DataNode 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

      public DataNode 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 sub node differs.
      Returns:
      true if this node or a sub node differs
    • getNodes

      public List<DataDiff> getNodes()
      Gets the sub nodes.
      Specified by:
      getNodes in interface DataNode
      Returns:
      the sub nodes
    • getComment

      public String getComment()
      Description copied from interface: DataNode
      The optional comment.
      Specified by:
      getComment in interface DataNode
      Returns:
      the comment, null if none
    • isHidden

      public boolean isHidden()
      Description copied from interface: DataNode
      Gets the hidden flag.
      Specified by:
      isHidden in interface DataNode
      Returns:
      true if object is hidden (no public method available)
    • getType

      @Bindable(ordinal=2) public String getType()
      Description copied from interface: DataNode
      Returns the type of the node.
      Can be any Java type, classname (w/o package) including optional generics.
      Example:
      List<Message>
      Specified by:
      getType in interface DataNode
      Returns:
      the type, never null and never empty
    • getName

      public String getName()
      Description copied from interface: DataNode
      Returns the name of the node.
      Can be the name of a property, an entity, class, interface, whatever.
      Specified by:
      getName in interface DataNode
      Returns:
      the name, never null and never empty
    • getValue

      public String getValue()
      Description copied from interface: DataNode
      Returns the value of the node.
      This is usually the toString value. For collections, it's the size.
      Specified by:
      getValue in interface DataNode
      Returns:
      the value, null if it's java value is null
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getNodeType

      public String getNodeType()
      Description copied from interface: DataNode
      Gets the name of this node type.
      Used to locate the image, for example.
      Specified by:
      getNodeType in interface DataNode
      Returns:
      the node type name
    • getNode

      @Bindable(ordinal=1) public DataNode getNode()
    • getLeftValue

      @Bindable(ordinal=3) public String getLeftValue()
      Gets the left value.
      Returns:
      null if none
    • getRightValue

      @Bindable(ordinal=4) public String 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

      public void setConfigurationPath(String configurationPath)
      Description copied from interface: DataNode
      Sets the optional configuration path.
      Specified by:
      setConfigurationPath in interface DataNode
      Parameters:
      configurationPath - the path
    • getConfigurationPath

      public String getConfigurationPath()
      Description copied from interface: DataNode
      Gets the optional configuration path.
      Specified by:
      getConfigurationPath in interface DataNode
      Returns:
      the path, null if none
    • getSqlCondition

      public SqlCondition getSqlCondition()
      Description copied from interface: DataNode
      Returns the SQL select configuration for the where clause.
      Specified by:
      getSqlCondition in interface DataNode
      Returns:
      the sql config
    • getEntity

      public Entity getEntity()
      Description copied from interface: DataNode
      Gets the entity this node belongs to.
      Specified by:
      getEntity in interface DataNode
      Returns:
      the entity
    • compare

      public static DataDiff compare(DataObject left, DataObject right)
      Compares the data of a PDO between two locations.
      Parameters:
      left - the data of the left location, must not be null
      right - the data of the right location, null if just show the data and don't compare
      Returns:
      the comparison