Package 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 Details

    • 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 Details

    • 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