org.mondemand

Class TraceId

Implemented Interfaces:
Comparable

public class TraceId
extends java.lang.Object
implements Comparable

Field Summary

static TraceId
NULL_TRACE_ID

Constructor Summary

TraceId()
Default constructor, if no id is given
TraceId(long id)
Create a trace ID with the given identifier

Method Summary

int
compareTo(TraceId traceId)
Compares this TraceId with another.
long
getId()
Accessor which returns the identifier for this trace id
void
setId(long newId)
Mutator which allows the identifier to be overwritten

Field Details

NULL_TRACE_ID

public static final TraceId NULL_TRACE_ID

Constructor Details

TraceId

public TraceId()
Default constructor, if no id is given

TraceId

public TraceId(long id)
Create a trace ID with the given identifier
Parameters:
id - the identifier to use

Method Details

compareTo

public int compareTo(TraceId traceId)
Compares this TraceId with another.
Returns:
1 if the caller's id is greater than the arg's id, -1 if it is less than, and 0 if they are equal.

getId

public long getId()
Accessor which returns the identifier for this trace id
Returns:
the id as a long

setId

public void setId(long newId)
Mutator which allows the identifier to be overwritten
Parameters:
newId - the new identifier for this trace id