Package net.shibboleth.shared.primitive
Class TimerSupport
java.lang.Object
net.shibboleth.shared.primitive.TimerSupport
Timer utility methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetTimerName(Object obj) Produce the name which should be used for aTimerowned by the specified object.static StringgetTimerName(Object obj, String additionalData) Produce the name which should be used for aTimerowned by the specified object.static StringgetTimerName(String baseName, String additionalData) Produce the name for aTimerbased on the specified base name.private static StringuncheckedGetTimerName(String baseName, String additionalData) Unchecked version ofgetTimerName(String, String)that assumes base name is non-null.
-
Constructor Details
-
TimerSupport
private TimerSupport()Constructor.
-
-
Method Details
-
getTimerName
Produce the name which should be used for aTimerowned by the specified object.The base name will be constructed as follows:
- if target is instance of
IdentifiedComponent, useIdentifiedComponent.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
- if target is instance of
-
getTimerName
@Nonnull @NotEmpty public static String getTimerName(@Nonnull Object obj, @Nullable String additionalData) Produce the name which should be used for aTimerowned by the specified object.The base name will be constructed as follows:
- if target is instance of
IdentifiedComponent, useIdentifiedComponent.getId()if non-empty - use
Object.toString()if non-empty - use serialized class name
- Parameters:
obj- the target object instance to evaluateadditionalData- additional qualifying data to include in the name- Returns:
- an appropriate name for a Timer owned by the specified object
- if target is instance of
-
getTimerName
@Nonnull @NotEmpty public static String getTimerName(@Nonnull String baseName, @Nullable String additionalData) Produce the name for aTimerbased on the specified base name.- Parameters:
baseName- the base name of TimeradditionalData- 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 ofgetTimerName(String, String)that assumes base name is non-null.- Parameters:
baseName- the base name of TimeradditionalData- additional qualifying data to include in the name- Returns:
- an appropriate name for a Timer based on the specified base name
-