Skip to content

Commit

Permalink
Improve toString() to be more helpful
Browse files Browse the repository at this point in the history
- Improve code style
  • Loading branch information
Mats-SX committed Mar 3, 2016
1 parent 4a60b64 commit 0de79ea
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
Expand Up @@ -41,9 +41,7 @@ public boolean matches( Object value )
{
for ( int i = 0; i < list.size(); ++i )
{
ValueMatcher valueMatcher = list.get( i );
Object value1 = realList.get( i );
match &= valueMatcher.matches( value1 );
match &= list.get( i ).matches( realList.get( i ) );
}
}
return match;
Expand Down
Expand Up @@ -59,6 +59,6 @@ public boolean matches( Object value )
@Override
public String toString()
{
return "MapMatcher for " + map.toString();
return "MapMatcher {" + map.toString();
}
}
Expand Up @@ -61,6 +61,6 @@ public boolean matches( Object value )
@Override
public String toString()
{
return "NodeMatcher for a node with labelNames: " + labelNames + " and properties: " + propertyMatcher;
return "NodeMatcher (" + labelNames + ") " + propertyMatcher;
}
}
Expand Up @@ -65,7 +65,7 @@ public void setRightNode( NodeMatcher rightNode )
@Override
public String toString()
{
return "PathLinkMatcher for "
return "PathLinkMatcher "
+ leftNode + (outgoing ? "-" : "<-")
+ relMatcher + (outgoing ? "->" : "-")
+ rightNode;
Expand Down
Expand Up @@ -62,7 +62,8 @@ public boolean matches( Object value )
if ( matches )
{
Iterator<Relationship> relationships = path.relationships().iterator();
for (PathLinkMatcher pathLink : pathLinks) {
for ( PathLinkMatcher pathLink : pathLinks )
{
pathLink.matches( relationships.next() );
}
}
Expand All @@ -75,10 +76,12 @@ public boolean matches( Object value )
@Override
public String toString()
{
if (pathLinks.isEmpty())
if ( pathLinks.isEmpty() )
{
return "PathMatcher for " + singleNodePath;
}
else
{
return "PathMatcher for " + singleNodePath;
} else {
return "PathMatcher for " + pathLinks;
}
}
Expand Down
Expand Up @@ -48,6 +48,6 @@ public boolean matches( Object value )
@Override
public String toString()
{
return "RelationshipMatcher for type " + relationshipTypeName + " and properties: " + propertyMatcher;
return "RelationshipMatcher [" + relationshipTypeName + "] " + propertyMatcher;
}
}
Expand Up @@ -49,6 +49,6 @@ public boolean matches( Map<String,Object> value )
@Override
public String toString()
{
return "RowMatcher with " + values;
return "RowMatcher(" + values + ")";
}
}
Expand Up @@ -37,6 +37,6 @@ public boolean matches( Object value )
@Override
public String toString()
{
return "StringMatcher for " + string;
return "StringMatcher(" + string + ")";
}
}

0 comments on commit 0de79ea

Please sign in to comment.