Top Description Fields Constructors Methods
org.slf4j.helpers

public Class NormalizedParameters

extends Object
Class Inheritance
Imports
org.slf4j.event.LoggingEvent

Holds normalized call parameters. Includes utility methods such as normalize(String, Object[], Throwable) to help the normalization of parameters.
Author
ceki
Since
2.0

Field Summary

Modifier and TypeField and Description
pack-priv final Object[]
pack-priv final String
pack-priv final Throwable

Constructor Summary

AccessConstructor and Description
public
NormalizedParameters(String message, Object[] arguments, Throwable throwable)

public
NormalizedParameters(String message, Object[] arguments)

Method Summary

Modifier and TypeMethod and Description
public Object[]
public String
public Throwable
public static Throwable

Returns:

if the last Object in argArray is a Throwable this method will return it, otherwise it returns null
getThrowableCandidate
(final Object[]
The arguments off which we want to know if it contains a Throwable as last element
argArray
)

Helper method to determine if an Object array contains a Throwable as last element

public static NormalizedParameters
normalize(String msg, Object[] arguments, Throwable t)

This method serves to normalize logging call invocation parameters.

public static NormalizedParameters
public static Object[]

Returns:

a copy of the array without the last element
trimmedCopy
(final Object[]
The arguments from which we want to remove the last element
argArray
)

Helper method to get all but the last element of an array

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

argumentsback to summary
pack-priv final Object[] arguments
messageback to summary
pack-priv final String message
throwableback to summary
pack-priv final Throwable throwable

Constructor Detail

NormalizedParametersback to summary
public NormalizedParameters(String message, Object[] arguments, Throwable throwable)
NormalizedParametersback to summary
public NormalizedParameters(String message, Object[] arguments)

Method Detail

getArgumentsback to summary
public Object[] getArguments()
getMessageback to summary
public String getMessage()
getThrowableback to summary
public Throwable getThrowable()
getThrowableCandidateback to summary
public static Throwable getThrowableCandidate(final Object[] argArray)

Helper method to determine if an Object array contains a Throwable as last element

Parameters
argArray:Object[]

The arguments off which we want to know if it contains a Throwable as last element

Returns:Throwable

if the last Object in argArray is a Throwable this method will return it, otherwise it returns null

normalizeback to summary
public static NormalizedParameters normalize(String msg, Object[] arguments, Throwable t)

This method serves to normalize logging call invocation parameters. More specifically, if a throwable argument is not supplied directly, it attempts to extract it from the argument array.

normalizeback to summary
public static NormalizedParameters normalize(LoggingEvent event)
trimmedCopyback to summary
public static Object[] trimmedCopy(final Object[] argArray)

Helper method to get all but the last element of an array

Parameters
argArray:Object[]

The arguments from which we want to remove the last element

Returns:Object[]

a copy of the array without the last element