Package net.shibboleth.shared.primitive

# Class TimerSupport

java.lang.Object
net.shibboleth.shared.primitive.TimerSupport

public final class TimerSupport extends Object
Timer utility methods.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`private`
`TimerSupport()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`static String`
`getTimerName(Object obj)`
Produce the name which should be used for a `Timer` owned by the specified object.
`static String`
`getTimerName(Object obj, String additionalData)`
Produce the name which should be used for a `Timer` owned by the specified object.
`static String`
`getTimerName(String baseName, String additionalData)`
Produce the name for a `Timer` based on the specified base name.
`private static String`
`uncheckedGetTimerName(String baseName, String additionalData)`
Unchecked version of `getTimerName(String, String)` that assumes base name is non-null.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### TimerSupport

private TimerSupport()
Constructor.

## Method Details

### getTimerName

@Nonnull @NotEmpty public static String getTimerName(@Nonnull Object obj)
Produce the name which should be used for a `Timer` owned by the specified object.

The base name will be constructed as follows:

- if target is instance of `IdentifiedComponent`, use `IdentifiedComponent.getId()` if non-empty
- use `Object.toString()` if non-empty
- use serialized class name

Parameters:
  `obj` - the target object instance to evaluate
Returns:
  an appropriate name for a Timer owned by the specified object

### getTimerName

@Nonnull @NotEmpty public static String getTimerName(@Nonnull Object obj, @Nullable String additionalData)
Produce the name which should be used for a `Timer` owned by the specified object.

The base name will be constructed as follows:

- if target is instance of `IdentifiedComponent`, use `IdentifiedComponent.getId()` if non-empty
- use `Object.toString()` if non-empty
- use serialized class name

Parameters:
  `obj` - the target object instance to evaluate
  `additionalData` - additional qualifying data to include in the name
Returns:
  an appropriate name for a Timer owned by the specified object

### getTimerName

@Nonnull @NotEmpty public static String getTimerName(@Nonnull String baseName, @Nullable String additionalData)
Produce the name for a `Timer` based on the specified base name.

Parameters:
  `baseName` - the base name of Timer
  `additionalData` - additional qualifying data to include in the name
Returns:
  an appropriate name for a Timer based on the specified base name

### uncheckedGetTimerName

@Nonnull @NotEmpty private static String uncheckedGetTimerName(@Nonnull String baseName, @Nullable String additionalData)
Unchecked version of `getTimerName(String, String)` that assumes base name is non-null.

Parameters:
  `baseName` - the base name of Timer
  `additionalData` - additional qualifying data to include in the name
Returns:
  an appropriate name for a Timer based on the specified base name