tigase.server

## Class ComponentInfo

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

-     public class ComponentInfo
      extends Object

  Helper class for storing and handling additional informations about components
  Author:
    Wojciech Kapcia

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ComponentInfo(Class<?> c)` Creates ComponentInfo object with initial data
    `ComponentInfo(String cmpName, Class<?> c)` Creates ComponentInfo object with initial data
    `ComponentInfo(String cmpTitle, String cmpVersion, String cmpCls)` Creates ComponentInfo object with initial data
    `ComponentInfo(String cmpName, String cmpTitle, String cmpVersion, String cmpCls)` Creates ComponentInfo object with initial data
    `ComponentInfo(String cmpName, String cmpTitle, String cmpVersion, String cmpCls, HashMap<String,Object> cmpData)` Creates ComponentInfo object with initial data

  - ### Method Summary

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

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

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

- - ### Constructor Detail

    - #### ComponentInfo

          public ComponentInfo(String cmpTitle,
                               String cmpVersion,
                               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(String cmpName,
                               String cmpTitle,
                               String cmpVersion,
                               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(String cmpName,
                               String cmpTitle,
                               String cmpVersion,
                               String cmpCls,
                               HashMap<String,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(Class<?> c)

      Creates ComponentInfo object with initial data
      Parameters:
        `c` - class of the component

    - #### ComponentInfo

          public ComponentInfo(String cmpName,
                               Class<?> c)

      Creates ComponentInfo object with initial data
      Parameters:
        `cmpName` - name of the component
        `c` - class of the component

  - ### Method Detail

    - #### getImplementation

          public static Package getImplementation(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 String getImplementationInfo(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 String getImplementationTitle(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 Optional<Version> getImplementationVersion(String... classes)

    - #### getImplementationVersion

          public static String getImplementationVersion(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 Optional<ComponentInfo> of(String className)

    - #### getName

          public String getName()

      Allows retrieving of component's name
      Returns:
        component name

    - #### getComponentTitle

          public String getComponentTitle()

      Allows retrieving of component's title
      Returns:
        component title

    - #### getComponentVersion

          public String getComponentVersion()

      Allows retrieving of component's version
      Returns:
        component version

    - #### getComponentClass

          public String getComponentClass()

      Allows retrieving of component's class
      Returns:
        component class

    - #### getComponentData

          public HashMap<String,Object> getComponentData()

      Allows retrieving of component's additional data
      Returns:
        component additional data

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### toElement

          public Element toElement()

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

Copyright © 2004–2021 "Tigase, Inc.". All rights reserved.