@Immutable
public abstract class Version
extends Object
Subclasses provide the implementation version specified in the manifest of the jar from which they were loaded.
Modifier and Type | Field and Description |
---|---|
static String |
APPLICATION_NAME_ATTRIBUTE
Application name attribute.
|
static String |
BUNDLE_VERSION_ATTRIBUTE
Bundle version attribute.
|
static String |
IMPLEMENTATION_REVISION_ATTRIBUTE
Implementation revision attribute.
|
static String |
PROBLEM_INDICATOR
Problem indicator.
|
static String |
SPECIFICATION_VERSION_ATTRIBUTE
Specification version attribute.
|
static String |
UNKNOWN_INDICATOR
Unknown indicator.
|
Constructor and Description |
---|
Version() |
Modifier and Type | Method and Description |
---|---|
Optional<DateTime> |
getContainerDateTime()
Gets the date-time of the container of this class.
|
static Optional<DateTime> |
getContainerDateTime(String resourcePath)
Gets the date-time of the container of a resource.
|
Optional<File> |
getContainerFile()
Gets the file of the container of this class.
|
static Optional<File> |
getContainerFile(String resourcePath)
Gets the file of the container of a resource.
|
String |
getImplementationRevision()
Gets the implementation revision text.
|
String |
getImplementationTitle()
Gets the implementation title.
|
String |
getImplementationVendor()
Gets the implementation vendor text.
|
String |
getImplementationVersion()
Gets the implementation version text.
|
static Manifest |
getManifest(Class<?> objectClass)
Gets the manifest from the jar containing an object class.
|
static String |
getManifestAttribute(Manifest manifest,
String attributeName)
Gets an attribute from a jar manifest.
|
String |
getSpecificationTitle()
Gets the specification title.
|
String |
getSpecificationVendor()
Gets the specification vendor text.
|
String |
getSpecificationVersion()
Gets the specification version text.
|
void |
logImplementation(boolean quiet)
Logs the implementation.
|
void |
logSpecification(boolean quiet)
Logs the specification ident.
|
void |
logSystemInfo(String identification)
Logs system informations.
|
void |
logSystemInfo(String identification,
boolean quiet)
Logs system informations.
|
public static final String APPLICATION_NAME_ATTRIBUTE
public static final String BUNDLE_VERSION_ATTRIBUTE
public static final String IMPLEMENTATION_REVISION_ATTRIBUTE
public static final String PROBLEM_INDICATOR
public static final String SPECIFICATION_VERSION_ATTRIBUTE
public static final String UNKNOWN_INDICATOR
@Nonnull @CheckReturnValue public static Optional<DateTime> getContainerDateTime(@Nonnull String resourcePath)
resourcePath
- The resource path.@Nonnull @CheckReturnValue public static Optional<File> getContainerFile(@Nonnull String resourcePath)
resourcePath
- The resource path.@Nonnull @CheckReturnValue public static Manifest getManifest(@Nonnull Class<?> objectClass)
objectClass
- The object class.@Nonnull @CheckReturnValue public static String getManifestAttribute(@Nonnull Manifest manifest, @Nonnull String attributeName)
manifest
- The manifest.attributeName
- The attribute name.PROBLEM_INDICATOR
when missing).@Nonnull @CheckReturnValue public final Optional<DateTime> getContainerDateTime()
@Nonnull @CheckReturnValue public final Optional<File> getContainerFile()
@Nonnull @CheckReturnValue public final String getImplementationRevision()
@Nonnull @CheckReturnValue public final String getImplementationTitle()
@Nonnull @CheckReturnValue public final String getImplementationVendor()
@Nonnull @CheckReturnValue public final String getImplementationVersion()
@Nonnull @CheckReturnValue public final String getSpecificationTitle()
@Nonnull @CheckReturnValue public final String getSpecificationVendor()
@Nonnull @CheckReturnValue public final String getSpecificationVersion()
public void logImplementation(boolean quiet)
quiet
- True for quiet logging (DEBUG instead of INFO).public void logSpecification(boolean quiet)
quiet
- True for quiet logging (DEBUG instead of INFO).public void logSystemInfo(@Nonnull String identification)
identification
- The caller's identification.public void logSystemInfo(@Nonnull String identification, boolean quiet)
identification
- The caller's identification.quiet
- True for quiet logging (DEBUG instead of INFO).Copyright © 2003-2019 Serge Brisson. All Rights Reserved.