Interface ProfileContext


@NonNullByDefault public interface ProfileContext
The profile's context It gives access to related information like the profile's configuration or a scheduler.
Author:
Simon Kaufmann - Initial contribution, Jan N. Klug - Add accepted type methods
  • Method Summary

    Modifier and Type
    Method
    Description
    default List<Class<? extends Command>>
    Get the list of accepted command types for commands send to the linked item This is an optional method and will return an empty list if not implemented.
    default List<Class<? extends State>>
    Get the list of accepted data types for state updates to the linked item This is an optional method and will return an empty list if not implemented.
    Get the profile's configuration object
    <T> T
    getConfigurationAs(Class<T> configurationClass)
    Returns the configuration of the profile and transforms it to the given class.
    Get a scheduler to be used within profiles (if needed at all)
    default List<Class<? extends Command>>
    Get the list of accepted command types for commands sent to the handler This is an optional method and will return an empty list if not implemented.
  • Method Details

    • getConfiguration

      Configuration getConfiguration()
      Get the profile's configuration object
      Returns:
      the configuration
    • getConfigurationAs

      <T> T getConfigurationAs(Class<T> configurationClass)
      Returns the configuration of the profile and transforms it to the given class.
      Parameters:
      configurationClass - configuration class
      Returns:
      configuration of profile in form of the given class
    • getExecutorService

      ScheduledExecutorService getExecutorService()
      Get a scheduler to be used within profiles (if needed at all)
      Returns:
      the scheduler
    • getAcceptedDataTypes

      default List<Class<? extends State>> getAcceptedDataTypes()
      Get the list of accepted data types for state updates to the linked item This is an optional method and will return an empty list if not implemented.
      Returns:
      A list of all accepted data types
    • getAcceptedCommandTypes

      default List<Class<? extends Command>> getAcceptedCommandTypes()
      Get the list of accepted command types for commands send to the linked item This is an optional method and will return an empty list if not implemented.
      Returns:
      A list of all accepted command types
    • getHandlerAcceptedCommandTypes

      default List<Class<? extends Command>> getHandlerAcceptedCommandTypes()
      Get the list of accepted command types for commands sent to the handler This is an optional method and will return an empty list if not implemented.
      Returns:
      A list of all accepted command types