org.sonatype.aether.util
Class DefaultRequestTrace

java.lang.Object
  extended by org.sonatype.aether.util.DefaultRequestTrace
All Implemented Interfaces:
RequestTrace

public class DefaultRequestTrace
extends java.lang.Object
implements RequestTrace

A simple request trace.

Author:
Benjamin Bentmann

Constructor Summary
DefaultRequestTrace(java.lang.Object data)
          Creates a new root trace with the specified data.
 
Method Summary
 java.lang.Object getData()
          Gets the data associated with this trace.
 RequestTrace getParent()
          Gets the parent of this trace.
 RequestTrace newChild(java.lang.Object data)
          Creates a new child of this trace.
static RequestTrace newChild(RequestTrace parent, java.lang.Object data)
          Creates a child of the specified request trace.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultRequestTrace

public DefaultRequestTrace(java.lang.Object data)
Creates a new root trace with the specified data.

Parameters:
data - The data to associate with the trace, may be null.
Method Detail

newChild

public static RequestTrace newChild(RequestTrace parent,
                                    java.lang.Object data)
Creates a child of the specified request trace. This method is basically a convenience that will invoke RequestTrace.newChild(Object) when the specified parent trace is not null or otherwise instantiante of new root trace.

Parameters:
parent - The parent request trace, may be null.
data - The data to associate with the child trace, may be null.
Returns:
The child trace, never null.

getData

public java.lang.Object getData()
Description copied from interface: RequestTrace
Gets the data associated with this trace.

Specified by:
getData in interface RequestTrace
Returns:
The data associated with this trace or null.

getParent

public RequestTrace getParent()
Description copied from interface: RequestTrace
Gets the parent of this trace.

Specified by:
getParent in interface RequestTrace
Returns:
The parent of this trace or null if this is the root of the trace stack.

newChild

public RequestTrace newChild(java.lang.Object data)
Description copied from interface: RequestTrace
Creates a new child of this trace.

Specified by:
newChild in interface RequestTrace
Parameters:
data - The data to associate with the child, may be null.
Returns:
The child trace, never null.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010-2011 Sonatype, Inc.. All Rights Reserved.