public class AppDescriptor
extends java.lang.Object
implements java.io.Serializable
Describe an application’s name, package and version
Modifier and Type | Method and Description |
---|---|
static AppDescriptor |
deserializeFrom(byte[] bytes)
Deserialize an
AppDescriptor from byte array |
java.lang.String |
getAppName()
Returns the app name
|
java.lang.String |
getPackageName()
Returns the package name
|
org.osgl.bootstrap.Version |
getVersion()
Returns the app version
|
boolean |
isValid()
Check if this
AppVersion data is valid. |
static AppDescriptor |
of(java.lang.Class<?> entryClass)
Create an
AppDescriptor with entry class (the class with main method) |
static AppDescriptor |
of(java.lang.String packageName)
Create an
AppDescriptor with package name. |
static AppDescriptor |
of(java.lang.String appName,
java.lang.Class<?> entryClass)
Create an
AppDescriptor with appName and entry class specified. |
static AppDescriptor |
of(java.lang.String appName,
java.lang.Class<?> entryClass,
org.osgl.bootstrap.Version appVersion)
Create an
AppDescriptor with appName, entry class and app version. |
static AppDescriptor |
of(java.lang.String appName,
java.lang.String packageName)
Create an
AppDescriptor with appName and package name specified |
static AppDescriptor |
of(java.lang.String appName,
java.lang.String packageName,
org.osgl.bootstrap.Version appVersion)
Create an
AppDescriptor with appName, package name and app version. |
byte[] |
toByteArray()
Serialize this
AppDescriptor and output byte array |
public java.lang.String getAppName()
Returns the app name
public java.lang.String getPackageName()
Returns the package name
public org.osgl.bootstrap.Version getVersion()
Returns the app version
public boolean isValid()
Check if this AppVersion
data is valid.
An AppVersion
is considered to be valid if and only if the getVersion()
is not unknown
true
if this AppVersion
is valid or false
otherwisepublic byte[] toByteArray()
Serialize this AppDescriptor
and output byte array
AppDescriptor
into byte arraypublic static AppDescriptor of(java.lang.String appName, java.lang.String packageName, org.osgl.bootstrap.Version appVersion)
Create an AppDescriptor
with appName, package name and app version.
If appName
is null
or blank, it will try the following approach to get app name:
artifact id
and use it unlessAppNameInferer
appName
- the app name, optionalpackageName
- the package nameappVersion
- the app versionAppDescriptor
public static AppDescriptor of(java.lang.String appName, java.lang.Class<?> entryClass, org.osgl.bootstrap.Version appVersion)
Create an AppDescriptor
with appName, entry class and app version.
If appName
is null
or blank, it will try the following approach to get app name:
artifact id
and use it unlessAppNameInferer
appName
- the app name, optionalentryClass
- the entry classappVersion
- the app versionAppDescriptor
public static AppDescriptor of(java.lang.String appName, java.lang.Class<?> entryClass)
Create an AppDescriptor
with appName and entry class specified.
If appName
is null
or blank, it will try the following approach to get app name:
artifact id
and use it unlessAppNameInferer
appName
- the app nameentryClass
- the entry classAppDescriptor
instancepublic static AppDescriptor of(java.lang.String appName, java.lang.String packageName)
Create an AppDescriptor
with appName and package name specified
If appName
is null
or blank, it will try the following approach to get app name:
artifact id
and use it unlessAppNameInferer
appName
- the app namepackageName
- the package name of the appAppDescriptor
instancepublic static AppDescriptor of(java.lang.String packageName)
Create an AppDescriptor
with package name.
This method relies on Version.ofPackage(String)
to get the corresponding Version
instance to the package name.
packageName
- the package nameAppDescriptor
instancepublic static AppDescriptor of(java.lang.Class<?> entryClass)
Create an AppDescriptor
with entry class (the class with main method)
This method relies on Version.of(Class)
to get the corresponding Version
instance to the entry class
entryClass
- the entry classAppDescriptor
instancepublic static AppDescriptor deserializeFrom(byte[] bytes)
Deserialize an AppDescriptor
from byte array
bytes
- the byte arrayAppDescriptor
instanceCopyright © 2014–2017 ActFramework. All rights reserved.