Interface TinyTaskConfService

  • All Implemented Interfaces:

    
    public interface TinyTaskConfService
    
                        

    Configure the properties of Tasker, compare the database and configuration files, giving priority to the larger version. When the versions are the same, prioritize the database. Additionally, provide default configurations that can be inherited for non-independent properties.

    Since:

    2022-12-11

    Author:

    trydofor

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract TinyTaskConfService.Conf config(@NotNull() Object bean, @NotNull() Method method, @Nullable() Object para)
      Configure the TinyTasker annotated and enabled method , return the taskId.
      - throw exception if property not exist
      - save to database if not exist in database
      - save to database, if exist in database, but higher version
      - otherwise no operation
      
      abstract Set<TinyTaskConfService.Conf> config(@NotNull() Object bean) Configures all TinyTasker annotated methods, and returns the taskId and its config.
      abstract TaskerProp database(long id, boolean nonnull) Load properties from database by taskId
      abstract TaskerProp property(long id, boolean nonnull) Load properties from config file, get value by key
      abstract LinkedHashMap<String, Diff.V<out Object>> diffProp(long id)
      abstract boolean enable(long id, boolean enabled) Enable or disable the task
      abstract boolean replace(long id, TaskerProp prop) Save properties to database
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • config

         abstract TinyTaskConfService.Conf config(@NotNull() Object bean, @NotNull() Method method, @Nullable() Object para)
        Configure the TinyTasker annotated and enabled method , return the taskId.
        - throw exception if property not exist
        - save to database if not exist in database
        - save to database, if exist in database, but higher version
        - otherwise no operation
        
      • config

        @NotNull() abstract Set<TinyTaskConfService.Conf> config(@NotNull() Object bean)

        Configures all TinyTasker annotated methods, and returns the taskId and its config. Throw exception if autorun but para is incorrect.

      • database

        @Contract(value = "_,true->!null") abstract TaskerProp database(long id, boolean nonnull)

        Load properties from database by taskId

      • property

        @Contract(value = "_,true->!null") abstract TaskerProp property(long id, boolean nonnull)

        Load properties from config file, get value by key

      • enable

         abstract boolean enable(long id, boolean enabled)

        Enable or disable the task

      • replace

         abstract boolean replace(long id, TaskerProp prop)

        Save properties to database