Package com.gargoylesoftware.base.trace
Class TraceItem
java.lang.Object
com.gargoylesoftware.base.trace.TraceItem
- All Implemented Interfaces:
Cloneable
An item of data to be written.
- Version:
- $Revision: 1.4 $
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
assertNotNull
(String fieldName, Object fieldValue) Verify that the specified value is not null.(package private) void
clear()
Reset all the values to nullclone()
Return a copy of this object.boolean
Return true if this item contains any text.Return the channel.getLock()
Return the lock.Return the message.Return the next item.Return the previous item.(package private) Thread
Return the name of the thread that called Trace.Return the throwable.getTime()
Return the time that the item was written to Trace(package private) boolean
isClear()
(package private) void
setChannel
(TraceChannel channel) (package private) void
(package private) void
setMessage
(String string) (package private) void
setNextItem
(TraceItem item) (package private) void
setPrevItem
(TraceItem item) (package private) void
(package private) void
(package private) void
toString()
Return a string representation of this object for testing purposes.
-
Field Details
-
prevItem_
-
nextItem_
-
channel_
-
message_
-
throwable_
-
time_
-
thread_
-
lock_
-
-
Constructor Details
-
TraceItem
public TraceItem()Create a new item.
-
-
Method Details
-
clear
void clear()Reset all the values to null -
isClear
boolean isClear()- Returns:
- true if the message has no content
-
toString
Return a string representation of this object for testing purposes. -
containsText
public boolean containsText()Return true if this item contains any text.- Returns:
- true if this item contains any text.
-
getMessage
Return the message.- Returns:
- the message.
-
setMessage
- Parameters:
string
- The message
-
getThrowable
Return the throwable.- Returns:
- the throwable.
-
setThrowable
- Parameters:
t
- The throwable
-
getTime
Return the time that the item was written to Trace- Returns:
- the time.
-
setTime
- Parameters:
time
- The time
-
getThread
Thread getThread()- Returns:
- The thread
-
setThread
- Parameters:
thread
- The thread
-
getThreadName
Return the name of the thread that called Trace.- Returns:
- the name of the thread.
-
getLock
Return the lock.- Returns:
- the lock.
-
setLock
- Parameters:
lock
- The lock
-
getPrevItem
Return the previous item.- Returns:
- the previous item.
-
setPrevItem
- Parameters:
item
- The previous item
-
getNextItem
Return the next item.- Returns:
- the next item.
-
setNextItem
- Parameters:
item
- The next item
-
getChannel
Return the channel.- Returns:
- the channel.
-
setChannel
- Parameters:
channel
- The channel
-
clone
Return a copy of this object.- Overrides:
clone
in classObject
- Returns:
- A copy.
- Throws:
CloneNotSupportedException
- If this object is not cloneable.
-
assertNotNull
protected final void assertNotNull(String fieldName, Object fieldValue) throws DetailedNullPointerException Verify 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
-