Package com.gargoylesoftware.base.trace
Class TraceItem
- java.lang.Object
-
- com.gargoylesoftware.base.trace.TraceItem
-
- All Implemented Interfaces:
java.lang.Cloneable
public class TraceItem extends java.lang.Object implements java.lang.CloneableAn item of data to be written.- Version:
- $Revision: 1.4 $
-
-
Field Summary
Fields Modifier and Type Field Description private TraceChannelchannel_private java.lang.Objectlock_private java.lang.Stringmessage_private TraceItemnextItem_private TraceItemprevItem_private java.lang.Threadthread_private java.lang.Throwablethrowable_private java.util.Datetime_
-
Constructor Summary
Constructors Constructor Description TraceItem()Create a new item.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidassertNotNull(java.lang.String fieldName, java.lang.Object fieldValue)Verify that the specified value is not null.(package private) voidclear()Reset all the values to nulljava.lang.Objectclone()Return a copy of this object.booleancontainsText()Return true if this item contains any text.TraceChannelgetChannel()Return the channel.java.lang.ObjectgetLock()Return the lock.java.lang.StringgetMessage()Return the message.TraceItemgetNextItem()Return the next item.TraceItemgetPrevItem()Return the previous item.(package private) java.lang.ThreadgetThread()java.lang.StringgetThreadName()Return the name of the thread that called Trace.java.lang.ThrowablegetThrowable()Return the throwable.java.util.DategetTime()Return the time that the item was written to Trace(package private) booleanisClear()(package private) voidsetChannel(TraceChannel channel)(package private) voidsetLock(java.lang.Object lock)(package private) voidsetMessage(java.lang.String string)(package private) voidsetNextItem(TraceItem item)(package private) voidsetPrevItem(TraceItem item)(package private) voidsetThread(java.lang.Thread thread)(package private) voidsetThrowable(java.lang.Throwable t)(package private) voidsetTime(java.util.Date time)java.lang.StringtoString()Return a string representation of this object for testing purposes.
-
-
-
Field Detail
-
prevItem_
private TraceItem prevItem_
-
nextItem_
private TraceItem nextItem_
-
channel_
private TraceChannel channel_
-
message_
private java.lang.String message_
-
throwable_
private java.lang.Throwable throwable_
-
time_
private java.util.Date time_
-
thread_
private java.lang.Thread thread_
-
lock_
private java.lang.Object lock_
-
-
Method Detail
-
clear
void clear()
Reset all the values to null
-
isClear
boolean isClear()
- Returns:
- true if the message has no content
-
toString
public java.lang.String toString()
Return a string representation of this object for testing purposes.- Overrides:
toStringin classjava.lang.Object- Returns:
- The string representation
-
containsText
public boolean containsText()
Return true if this item contains any text.- Returns:
- true if this item contains any text.
-
getMessage
public java.lang.String getMessage()
Return the message.- Returns:
- the message.
-
setMessage
void setMessage(java.lang.String string)
- Parameters:
string- The message
-
getThrowable
public java.lang.Throwable getThrowable()
Return the throwable.- Returns:
- the throwable.
-
setThrowable
void setThrowable(java.lang.Throwable t)
- Parameters:
t- The throwable
-
getTime
public java.util.Date getTime()
Return the time that the item was written to Trace- Returns:
- the time.
-
setTime
void setTime(java.util.Date time)
- Parameters:
time- The time
-
getThread
java.lang.Thread getThread()
- Returns:
- The thread
-
setThread
void setThread(java.lang.Thread thread)
- Parameters:
thread- The thread
-
getThreadName
public java.lang.String getThreadName()
Return the name of the thread that called Trace.- Returns:
- the name of the thread.
-
getLock
public java.lang.Object getLock()
Return the lock.- Returns:
- the lock.
-
setLock
void setLock(java.lang.Object lock)
- Parameters:
lock- The lock
-
getPrevItem
public TraceItem getPrevItem()
Return the previous item.- Returns:
- the previous item.
-
setPrevItem
void setPrevItem(TraceItem item)
- Parameters:
item- The previous item
-
getNextItem
public TraceItem getNextItem()
Return the next item.- Returns:
- the next item.
-
setNextItem
void setNextItem(TraceItem item)
- Parameters:
item- The next item
-
getChannel
public TraceChannel getChannel()
Return the channel.- Returns:
- the channel.
-
setChannel
void setChannel(TraceChannel channel)
- Parameters:
channel- The channel
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturn a copy of this object.- Overrides:
clonein classjava.lang.Object- Returns:
- A copy.
- Throws:
java.lang.CloneNotSupportedException- If this object is not cloneable.
-
assertNotNull
protected final void assertNotNull(java.lang.String fieldName, java.lang.Object fieldValue) throws DetailedNullPointerExceptionVerify that the specified value is not null. If it is then throw an exception- Parameters:
fieldName- The name of the field to checkfieldValue- The value of the field to check- Throws:
DetailedNullPointerException- If fieldValue is null
-
-