Package tigase.server
Class ComponentInfo
- java.lang.Object
-
- tigase.server.ComponentInfo
-
public class ComponentInfo extends java.lang.ObjectHelper class for storing and handling additional informations about components- Author:
- Wojciech Kapcia
-
-
Constructor Summary
Constructors Constructor Description ComponentInfo(java.lang.Class<?> c)Creates ComponentInfo object with initial dataComponentInfo(java.lang.String cmpName, java.lang.Class<?> c)Creates ComponentInfo object with initial dataComponentInfo(java.lang.String cmpTitle, java.lang.String cmpVersion, java.lang.String cmpCls)Creates ComponentInfo object with initial dataComponentInfo(java.lang.String cmpName, java.lang.String cmpTitle, java.lang.String cmpVersion, java.lang.String cmpCls)Creates ComponentInfo object with initial dataComponentInfo(java.lang.String cmpName, java.lang.String cmpTitle, java.lang.String cmpVersion, java.lang.String cmpCls, java.util.HashMap<java.lang.String,java.lang.Object> cmpData)Creates ComponentInfo object with initial data
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetComponentClass()Allows retrieving of component's classjava.util.HashMap<java.lang.String,java.lang.Object>getComponentData()Allows retrieving of component's additional datajava.lang.StringgetComponentTitle()Allows retrieving of component's titlejava.lang.StringgetComponentVersion()Allows retrieving of component's versionstatic java.lang.PackagegetImplementation(java.lang.Class<?> c)Allows retrieving implementation package (obtained from jar package) for a given classstatic java.lang.StringgetImplementationInfo(java.lang.Class<?> c)Allows retrieving implementation information (obtained from jar package) for a given classstatic java.lang.StringgetImplementationTitle(java.lang.Class<?> c)Allows retrieving implementation title (obtained from jar package) for a given classstatic java.lang.StringgetImplementationVersion(java.lang.Class<?> c)Allows retrieving implementation version (obtained from jar package) for a given classstatic java.util.Optional<Version>getImplementationVersion(java.lang.String... classes)java.lang.StringgetName()Allows retrieving of component's namestatic java.util.Optional<ComponentInfo>of(java.lang.String className)ElementtoElement()Allows retrieving of component's information as Elementjava.lang.StringtoString()
-
-
-
Constructor Detail
-
ComponentInfo
public ComponentInfo(java.lang.String cmpTitle, java.lang.String cmpVersion, java.lang.String cmpCls)Creates ComponentInfo object with initial data- Parameters:
cmpTitle- title of the componentcmpVersion- version of the componentcmpCls- class of the component
-
ComponentInfo
public ComponentInfo(java.lang.String cmpName, java.lang.String cmpTitle, java.lang.String cmpVersion, java.lang.String cmpCls)Creates ComponentInfo object with initial data- Parameters:
cmpName- name of the componentcmpTitle- title of the componentcmpVersion- version of the componentcmpCls- class of the component
-
ComponentInfo
public ComponentInfo(java.lang.String cmpName, java.lang.String cmpTitle, java.lang.String cmpVersion, java.lang.String cmpCls, java.util.HashMap<java.lang.String,java.lang.Object> cmpData)Creates ComponentInfo object with initial data- Parameters:
cmpName- name of the componentcmpTitle- title of the componentcmpVersion- version of the componentcmpCls- class of the componentcmpData- additional information about component
-
ComponentInfo
public ComponentInfo(java.lang.Class<?> c)
Creates ComponentInfo object with initial data- Parameters:
c- class of the component
-
ComponentInfo
public ComponentInfo(java.lang.String cmpName, java.lang.Class<?> c)Creates ComponentInfo object with initial data- Parameters:
cmpName- name of the componentc- class of the component
-
-
Method Detail
-
getImplementation
public static java.lang.Package getImplementation(java.lang.Class<?> c)
Allows retrieving implementation package (obtained from jar package) for a given class- Parameters:
c- class for which package is to be retrieved- Returns:
- package containing given class
-
getImplementationInfo
public static java.lang.String getImplementationInfo(java.lang.Class<?> c)
Allows retrieving implementation information (obtained from jar package) for a given class- Parameters:
c- class for which Package information is to be retrieved- Returns:
- title and version of the Package holding class
-
getImplementationTitle
public static java.lang.String getImplementationTitle(java.lang.Class<?> c)
Allows retrieving implementation title (obtained from jar package) for a given class- Parameters:
c- class for which Package title is to be retrieved- Returns:
- Package title of the given class
-
getImplementationVersion
public static java.util.Optional<Version> getImplementationVersion(java.lang.String... classes)
-
getImplementationVersion
public static java.lang.String getImplementationVersion(java.lang.Class<?> c)
Allows retrieving implementation version (obtained from jar package) for a given class- Parameters:
c- class for which Package version is to be retrieved- Returns:
- Package version of the given class
-
of
public static java.util.Optional<ComponentInfo> of(java.lang.String className)
-
getName
public java.lang.String getName()
Allows retrieving of component's name- Returns:
- component name
-
getComponentTitle
public java.lang.String getComponentTitle()
Allows retrieving of component's title- Returns:
- component title
-
getComponentVersion
public java.lang.String getComponentVersion()
Allows retrieving of component's version- Returns:
- component version
-
getComponentClass
public java.lang.String getComponentClass()
Allows retrieving of component's class- Returns:
- component class
-
getComponentData
public java.util.HashMap<java.lang.String,java.lang.Object> getComponentData()
Allows retrieving of component's additional data- Returns:
- component additional data
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toElement
public Element toElement()
Allows retrieving of component's information as Element- Returns:
- component information as Element
-
-