Top Description Methods
org.apache.logging.log4j

public Interface Marker

extends Serializable
Known Direct Implementers
org.apache.logging.log4j.MarkerManager.Log4jMarker
Imports
java.io.Serializable

Markers are objects that are used to add easily filterable information to log messages. Markers can be hierarchical - each Marker may have a parent. This allows for broad categories being subdivided into more specific categories. An example might be a Marker named "Error" with children named "SystemError" and "ApplicationError".

Method Summary

Modifier and TypeMethod and Description
public Marker

Returns:

The current Marker object, thus allowing multiple adds to be concatenated.
addParents
(Marker...
The parent markers to add.
markers
)

Adds a Marker as a parent to this Marker.

public boolean

Returns:

true if the given marker has the same name as this marker.
equals
(Object
the reference object with which to compare.
obj
)

Returns true if the given marker has the same name as this marker.

public String

Returns:

The name of the Marker.
getName
()

Returns the name of this Marker.

public Marker[]

Returns:

The parent Markers or null if this Marker has no parents.
getParents
()

Returns a list of parents of this Marker.

public int

Returns:

the computed hash code
hashCode
()

Returns a hash code value based on the name of this marker.

public boolean

Returns:

true if the Marker has parent Markers
hasParents
()

Indicates whether this Marker has references to any other Markers.

public boolean

Returns:

true if this Marker or one of its ancestors is the specified Marker, false otherwise.
isInstanceOf
(Marker
The Marker to check.
m
)

Checks whether this Marker is an instance of the specified Marker.

public boolean

Returns:

true if this Marker or one of its ancestors matches the specified name, false otherwise.
isInstanceOf
(String
The name of the Marker.
name
)

Checks whether this Marker is an instance of the specified Marker.

public boolean

Returns:

true if the marker was removed.
remove
(Marker
The marker to remove.
marker
)

Removes the specified Marker as a parent of this Marker.

public Marker

Returns:

The current Marker object.
setParents
(Marker...
The new set of parent Markers or null to clear the parents.
markers
)

Replaces the set of parent Markers with the provided Markers.

Method Detail

addParentsback to summary
public Marker addParents(Marker... markers)

Adds a Marker as a parent to this Marker.

Parameters
markers:Marker[]

The parent markers to add.

Returns:Marker

The current Marker object, thus allowing multiple adds to be concatenated.

Exceptions
IllegalArgumentException:
if the argument is null
equalsback to summary
public boolean equals(Object obj)

Returns true if the given marker has the same name as this marker.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if the given marker has the same name as this marker.

Annotations
@Override
Since
2.4
getNameback to summary
public String getName()

Returns the name of this Marker.

Returns:String

The name of the Marker.

getParentsback to summary
public Marker[] getParents()

Returns a list of parents of this Marker.

Returns:Marker[]

The parent Markers or null if this Marker has no parents.

hashCodeback to summary
public int hashCode()

Returns a hash code value based on the name of this marker. Markers are equal if they have the same name.

Returns:int

the computed hash code

Annotations
@Override
Since
2.4
hasParentsback to summary
public boolean hasParents()

Indicates whether this Marker has references to any other Markers.

Returns:boolean

true if the Marker has parent Markers

isInstanceOfback to summary
public boolean isInstanceOf(Marker m)

Checks whether this Marker is an instance of the specified Marker.

Parameters
m:Marker

The Marker to check.

Returns:boolean

true if this Marker or one of its ancestors is the specified Marker, false otherwise.

Exceptions
IllegalArgumentException:
if the argument is null
isInstanceOfback to summary
public boolean isInstanceOf(String name)

Checks whether this Marker is an instance of the specified Marker.

Parameters
name:String

The name of the Marker.

Returns:boolean

true if this Marker or one of its ancestors matches the specified name, false otherwise.

Exceptions
IllegalArgumentException:
if the argument is null
removeback to summary
public boolean remove(Marker marker)

Removes the specified Marker as a parent of this Marker.

Parameters
marker:Marker

The marker to remove.

Returns:boolean

true if the marker was removed.

Exceptions
IllegalArgumentException:
if the argument is null
setParentsback to summary
public Marker setParents(Marker... markers)

Replaces the set of parent Markers with the provided Markers.

Parameters
markers:Marker[]

The new set of parent Markers or null to clear the parents.

Returns:Marker

The current Marker object.