Skip to content

Commit

Permalink
HSEARCH-1271 Adding toString implementations for easier debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
hferentschik committed Oct 7, 2013
1 parent 68120ed commit b451243
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
13 changes: 12 additions & 1 deletion engine/src/main/java/org/hibernate/search/backend/spi/Work.java
Expand Up @@ -29,6 +29,7 @@
* A unit of work. Only make sense inside the same session since it uses the scope principle.
*
* @author Emmanuel Bernard
* @author Hardy Ferentschik
*/
public class Work<T> {
private final T entity;
Expand All @@ -54,7 +55,7 @@ public Work(T entity, WorkType type) {
}

private Work(T entity, Class<T> entityClass, Serializable id,
WorkType type, boolean identifierWasRolledBack) {
WorkType type, boolean identifierWasRolledBack) {
this.entity = entity;
this.entityClass = entityClass;
this.id = id;
Expand All @@ -81,4 +82,14 @@ public WorkType getType() {
public boolean isIdentifierWasRolledBack() {
return identifierWasRolledBack;
}

@Override
public String toString() {
final StringBuilder sb = new StringBuilder( "Work{" );
sb.append( "entityClass=" ).append( entityClass );
sb.append( ", id=" ).append( id );
sb.append( ", type=" ).append( type );
sb.append( '}' );
return sb.toString();
}
}
Expand Up @@ -273,6 +273,10 @@ private DepthValidator updateDepth(Object instance, ContainedInMetadata containe
}
}

@Override
public String toString() {
return "DocumentBuilder for {" + beanClass.getName() + "}";
}

/**
* A {@code XMember } instance treats a map as a collection as well in which case the map values are returned as
Expand Down

0 comments on commit b451243

Please sign in to comment.