Package tigase.server

## Class ComponentInfo

- java.lang.Object
- - tigase.server.ComponentInfo

-     public class ComponentInfo
      extends java.lang.Object

  Helper 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 data
    `ComponentInfo​(java.lang.String cmpName, java.lang.Class<?> c)` | Creates ComponentInfo object with initial data
    `ComponentInfo​(java.lang.String cmpTitle, java.lang.String cmpVersion, java.lang.String cmpCls)` | Creates ComponentInfo object with initial data
    `ComponentInfo​(java.lang.String cmpName, java.lang.String cmpTitle, java.lang.String cmpVersion, java.lang.String cmpCls)` | Creates ComponentInfo object with initial data
    `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

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.String` | `getComponentClass()` | Allows retrieving of component's class
    `java.util.HashMap<java.lang.String,​java.lang.Object>` | `getComponentData()` | Allows retrieving of component's additional data
    `java.lang.String` | `getComponentTitle()` | Allows retrieving of component's title
    `java.lang.String` | `getComponentVersion()` | Allows retrieving of component's version
    `static java.lang.Package` | `getImplementation​(java.lang.Class<?> c)` | Allows retrieving implementation package (obtained from jar package) for a given class
    `static java.lang.String` | `getImplementationInfo​(java.lang.Class<?> c)` | Allows retrieving implementation information (obtained from jar package) for a given class
    `static java.lang.String` | `getImplementationTitle​(java.lang.Class<?> c)` | Allows retrieving implementation title (obtained from jar package) for a given class
    `static java.lang.String` | `getImplementationVersion​(java.lang.Class<?> c)` | Allows retrieving implementation version (obtained from jar package) for a given class
    `static java.util.Optional<Version>` | `getImplementationVersion​(java.lang.String... classes)` |
    `java.lang.String` | `getName()` | Allows retrieving of component's name
    `static java.util.Optional<ComponentInfo>` | `of​(java.lang.String className)` |
    `Element` | `toElement()` | Allows retrieving of component's information as Element
    `java.lang.String` | `toString()` |

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

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

- - ### 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 component
        `cmpVersion` - version of the component
        `cmpCls` - 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 component
        `cmpTitle` - title of the component
        `cmpVersion` - version of the component
        `cmpCls` - 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 component
        `cmpTitle` - title of the component
        `cmpVersion` - version of the component
        `cmpCls` - class of the component
        `cmpData` - 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 component
        `c` - 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:
        `toString` in class `java.lang.Object`

    - #### toElement

          public Element toElement()

      Allows retrieving of component's information as Element
      Returns:
        component information as Element