Top Description Fields Constructors Methods
org.apache.logging.log4j.message

public Class StructuredDataId

extends Object
implements Serializable, StringBuilderFormattable
Class Inheritance
All Implemented Interfaces
org.apache.logging.log4j.util.StringBuilderFormattable, java.io.Serializable
Imports
aQute.bnd.annotation.baseline.BaselineIgnore, com.google.errorprone.annotations.InlineMe, java.io.Serializable, org.apache.logging.log4j.util.StringBuilderFormattable, .Strings

The StructuredData identifier.

Field Summary

Modifier and TypeField and Description
private static final String
private final String
private static final int
public static final StructuredDataId
META

RFC 5424 Meta.

private final String
private final String[]
public static final StructuredDataId
ORIGIN

RFC 5424 Origin.

private final String[]
public static final String
RESERVED

Reserved enterprise number.

private static final long
public static final StructuredDataId
TIME_QUALITY

RFC 5424 Time Quality.

Constructor Summary

AccessConstructor and Description
public
StructuredDataId(final String
The Structured Data Element name (maximum length is 32)
name
)

Creates a StructuredDataId based on the name.

public
StructuredDataId(final String
The Structured Data Element name.
name
,
final int
The maximum length of the name.
maxLength
)

Creates a StructuredDataId based on the name.

public
StructuredDataId(final String
The name portion of the id.
name
,
final String[]
The list of keys that are required for this id.
required
,
final String[]
The list of keys that are optional for this id.
optional
)

public
StructuredDataId(final String
The name portion of the id.
name
,
final String[]
The list of keys that are required for this id.
required
,
final String[]
The list of keys that are optional for this id.
optional
,
int
The maximum length of the id's name.
maxLength
)

A Constructor that helps conformance to RFC 5424.

public
StructuredDataId(final String
The name portion of the id.
name
,
final String
The enterprise number.
enterpriseNumber
,
final String[]
The list of keys that are required for this id.
required
,
final String[]
The list of keys that are optional for this id.
optional
)

A Constructor that helps conformance to RFC 5424.

public
StructuredDataId(final String
The name portion of the id.
name
,
final int
The enterprise number.
enterpriseNumber
,
final String[]
The list of keys that are required for this id.
required
,
final String[]
The list of keys that are optional for this id.
optional
)

A Constructor that helps conformance to RFC 5424.

public
StructuredDataId(final String
The name portion of the id.
name
,
final String
The enterprise number.
enterpriseNumber
,
final String[]
The list of keys that are required for this id.
required
,
final String[]
The list of keys that are optional for this id.
optional
,
final int
The maximum length of the StructuredData Id key.
maxLength
)

A Constructor that helps conformance to RFC 5424.

public
StructuredDataId(final String
The name portion of the id.
name
,
final int
The enterprise number.
enterpriseNumber
,
final String[]
The list of keys that are required for this id.
required
,
final String[]
The list of keys that are optional for this id.
optional
,
final int
The maximum length of the StructuredData Id key.
maxLength
)

A Constructor that helps conformance to RFC 5424.

Method Summary

Modifier and TypeMethod and Description
public void
formatTo(final StringBuilder
the StringBuilder to write into
buffer
)

Implements org.apache.logging.log4j.util.StringBuilderFormattable.formatTo.

Writes a text representation of this object into the specified StringBuilder, ideally without allocating temporary objects.

public String

Returns:

the enterprise number.
getEnterpriseNumber
()

Returns the enterprise number.

public String

Returns:

the StructuredDataId name.
getName
()

Returns the StructuredDataId name.

public String[]

Returns:

a List of optional keys or null if none have been provided.
getOptional
()

Returns a list of optional keys.

public String[]

Returns:

a List of required keys or null if none have been provided.
getRequired
()

Returns a list of required keys.

public boolean

Returns:

true if the id uses the reserved enterprise number, false otherwise.
isReserved
()

Indicates if the id is reserved.

public StructuredDataId

Returns:

the new StructuredDataId.
makeId
(final StructuredDataId
The original StructuredDataId.
id
)

Creates an id using another id to supply default values.

public StructuredDataId

Returns:

a StructuredDataId.
makeId
(final String
The default id to use if this StructuredDataId doesn't have a name.
defaultId
,
final String
The enterprise number.
anEnterpriseNumber
)

Creates an id based on the current id.

public final StructuredDataId

Returns:

a StructuredDataId.
makeId
(final String
The default id to use if this StructuredDataId doesn't have a name.
defaultId
,
final int
The enterprise number.
anEnterpriseNumber
)

Creates an id based on the current id.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

AT_SIGNback to summary
private static final String AT_SIGN
enterpriseNumberback to summary
private final String enterpriseNumber
MAX_LENGTHback to summary
private static final int MAX_LENGTH
METAback to summary
public static final StructuredDataId META

RFC 5424 Meta.

nameback to summary
private final String name
optionalback to summary
private final String[] optional
ORIGINback to summary
public static final StructuredDataId ORIGIN

RFC 5424 Origin.

requiredback to summary
private final String[] required
RESERVEDback to summary
public static final String RESERVED

Reserved enterprise number.

serialVersionUIDback to summary
private static final long serialVersionUID
TIME_QUALITYback to summary
public static final StructuredDataId TIME_QUALITY

RFC 5424 Time Quality.

Constructor Detail

StructuredDataIdback to summary
public StructuredDataId(final String name)

Creates a StructuredDataId based on the name.

Parameters
name:String

The Structured Data Element name (maximum length is 32)

Since
2.9
StructuredDataIdback to summary
public StructuredDataId(final String name, final int maxLength)

Creates a StructuredDataId based on the name.

Parameters
name:String

The Structured Data Element name.

maxLength:int

The maximum length of the name.

Since
2.9
StructuredDataIdback to summary
public StructuredDataId(final String name, final String[] required, final String[] optional)
Parameters
name:String

The name portion of the id.

required:String[]

The list of keys that are required for this id.

optional:String[]

The list of keys that are optional for this id.

StructuredDataIdback to summary
public StructuredDataId(final String name, final String[] required, final String[] optional, int maxLength)

A Constructor that helps conformance to RFC 5424.

Parameters
name:String

The name portion of the id.

required:String[]

The list of keys that are required for this id.

optional:String[]

The list of keys that are optional for this id.

maxLength:int

The maximum length of the id's name.

Since
2.9
StructuredDataIdback to summary
public StructuredDataId(final String name, final String enterpriseNumber, final String[] required, final String[] optional)

A Constructor that helps conformance to RFC 5424.

Parameters
name:String

The name portion of the id.

enterpriseNumber:String

The enterprise number.

required:String[]

The list of keys that are required for this id.

optional:String[]

The list of keys that are optional for this id.

StructuredDataIdback to summary
public StructuredDataId(final String name, final int enterpriseNumber, final String[] required, final String[] optional)

A Constructor that helps conformance to RFC 5424.

Parameters
name:String

The name portion of the id.

enterpriseNumber:int

The enterprise number.

required:String[]

The list of keys that are required for this id.

optional:String[]

The list of keys that are optional for this id.

Annotations
@Deprecated
@InlineMe
replacement:this(name, String.valueOf(enterpriseNumber), required, optional)
StructuredDataIdback to summary
public StructuredDataId(final String name, final String enterpriseNumber, final String[] required, final String[] optional, final int maxLength)

A Constructor that helps conformance to RFC 5424.

Parameters
name:String

The name portion of the id.

enterpriseNumber:String

The enterprise number.

required:String[]

The list of keys that are required for this id.

optional:String[]

The list of keys that are optional for this id.

maxLength:int

The maximum length of the StructuredData Id key.

Since
2.9
StructuredDataIdback to summary
public StructuredDataId(final String name, final int enterpriseNumber, final String[] required, final String[] optional, final int maxLength)

A Constructor that helps conformance to RFC 5424.

Parameters
name:String

The name portion of the id.

enterpriseNumber:int

The enterprise number.

required:String[]

The list of keys that are required for this id.

optional:String[]

The list of keys that are optional for this id.

maxLength:int

The maximum length of the StructuredData Id key.

Annotations
@InlineMe
replacement:this(name, String.valueOf(enterpriseNumber), required, optional, maxLength)
@Deprecated
Since
2.9

Method Detail

formatToback to summary
public void formatTo(final StringBuilder buffer)

Implements org.apache.logging.log4j.util.StringBuilderFormattable.formatTo.

Doc from org.apache.logging.log4j.util.StringBuilderFormattable.formatTo.

Writes a text representation of this object into the specified StringBuilder, ideally without allocating temporary objects.

Parameters
buffer:StringBuilder

the StringBuilder to write into

Annotations
@Override
getEnterpriseNumberback to summary
public String getEnterpriseNumber()

Returns the enterprise number.

Returns:String

the enterprise number.

getNameback to summary
public String getName()

Returns the StructuredDataId name.

Returns:String

the StructuredDataId name.

getOptionalback to summary
public String[] getOptional()

Returns a list of optional keys.

Returns:String[]

a List of optional keys or null if none have been provided.

getRequiredback to summary
public String[] getRequired()

Returns a list of required keys.

Returns:String[]

a List of required keys or null if none have been provided.

isReservedback to summary
public boolean isReserved()

Indicates if the id is reserved.

Returns:boolean

true if the id uses the reserved enterprise number, false otherwise.

makeIdback to summary
public StructuredDataId makeId(final StructuredDataId id)

Creates an id using another id to supply default values.

Parameters
id:StructuredDataId

The original StructuredDataId.

Returns:StructuredDataId

the new StructuredDataId.

makeIdback to summary
public StructuredDataId makeId(final String defaultId, final String anEnterpriseNumber)

Creates an id based on the current id.

Parameters
defaultId:String

The default id to use if this StructuredDataId doesn't have a name.

anEnterpriseNumber:String

The enterprise number.

Returns:StructuredDataId

a StructuredDataId.

makeIdback to summary
public final StructuredDataId makeId(final String defaultId, final int anEnterpriseNumber)

Creates an id based on the current id.

Parameters
defaultId:String

The default id to use if this StructuredDataId doesn't have a name.

anEnterpriseNumber:int

The enterprise number.

Returns:StructuredDataId

a StructuredDataId.

Annotations
@Deprecated
@BaselineIgnore:2.22.0
@InlineMe
replacement:this.makeId(defaultId, String.valueOf(anEnterpriseNumber))
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override