ttl-agent/src/main/java/com/alibaba/ttl3/agent/TtlAgent.java [246:371]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        return ttlAgentLoaded;
    }

    /**
     * Whether disable inheritable for thread pool is enhanced by ttl agent, check {@link #isTtlAgentLoaded()} first.
     * <p>
     * Same as {@code isBooleanOptionSet(TTL_AGENT_DISABLE_INHERITABLE_FOR_THREAD_POOL_KEY)}.
     *
     * @see TtlExecutors#getDefaultDisableInheritableThreadFactory()
     * @see TtlExecutors#getDisableInheritableThreadFactory(java.util.concurrent.ThreadFactory)
     * @see TtlExecutors#getDefaultDisableInheritableForkJoinWorkerThreadFactory()
     * @see TtlExecutors#getDisableInheritableForkJoinWorkerThreadFactory(java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory)
     * @see com.alibaba.ttl3.TransmittableThreadLocal
     * @see TtlAgent
     * @see #isBooleanOptionSet(String)
     * @see #TTL_AGENT_DISABLE_INHERITABLE_FOR_THREAD_POOL_KEY
     */
    public static boolean isDisableInheritableForThreadPool() {
        return isBooleanOptionSet(TTL_AGENT_DISABLE_INHERITABLE_FOR_THREAD_POOL_KEY);
    }

    /**
     * Whether timer task is enhanced by ttl agent, check {@link #isTtlAgentLoaded()} first.
     * <p>
     * Same as {@code isBooleanOptionSet(TTL_AGENT_ENABLE_TIMER_TASK_KEY, true)}.
     *
     * @see java.util.Timer
     * @see java.util.TimerTask
     * @see TtlAgent
     * @see #isBooleanOptionSet(String, boolean)
     * @see #TTL_AGENT_ENABLE_TIMER_TASK_KEY
     */
    public static boolean isEnableTimerTask() {
        return isBooleanOptionSet(TTL_AGENT_ENABLE_TIMER_TASK_KEY, true);
    }

    /**
     * Whether logging the transform class received by {@link TtlAgent}.
     * <p>
     * Same as {@code isBooleanOptionSet(TTL_AGENT_LOG_CLASS_TRANSFORM_KEY)}.
     *
     * @see TtlAgent
     * @see #isBooleanOptionSet(String)
     * @see #TTL_AGENT_LOG_CLASS_TRANSFORM_KEY
     */
    public static boolean isLogClassTransform() {
        return isBooleanOptionSet(TTL_AGENT_LOG_CLASS_TRANSFORM_KEY);
    }

    /**
     * Get the TTL Agent Log type.
     * <p>
     * Same as {@code getStringOptionValue(TTL_AGENT_LOGGER_KEY, Logger.STDERR)}.
     *
     * @see Logger
     * @see Logger#STDERR
     * @see Logger#STDOUT
     * @see TtlAgent
     * @see #getStringOptionValue(String, String)
     * @see #TTL_AGENT_LOGGER_KEY
     */
    @NonNull
    public static String getLoggerType() {
        return getStringOptionValue(TTL_AGENT_LOGGER_KEY, Logger.STDERR);
    }

    // ======== Generic Option Getters ========

    /**
     * Generic Option Getters for {@code boolean type} option.
     * <p>
     * Same as {@code isBooleanOptionSet(key, false)}.
     *
     * @see #isBooleanOptionSet(String, boolean)
     * @see TtlAgent
     */
    public static boolean isBooleanOptionSet(@NonNull String key) {
        return isBooleanOptionSet(key, false);
    }

    /**
     * Generic Option Getters for {@code boolean type} option.
     *
     * @see TtlAgent
     */
    public static boolean isBooleanOptionSet(@NonNull String key, boolean defaultValueIfKeyAbsent) {
        return TtlAgentHelper.isBooleanOptionSet(kvs, key, defaultValueIfKeyAbsent);
    }

    /**
     * Generic Option Getters for {@code string type} option.
     * <p>
     * usage example:
     * <p>
     * if {@code -Dttl.agent.logger=STDOUT} or
     * TTL Agent configuration is {@code -javaagent:/path/to/transmittable-thread-local-2.x.y.jar=ttl.agent.logger:STDOUT},
     * {@code getOptionValue("ttl.agent.logger")} return {@code STDOUT}.
     *
     * @see TtlAgent
     */
    @NonNull
    public static String getStringOptionValue(@NonNull String key, @NonNull String defaultValue) {
        return TtlAgentHelper.getStringOptionValue(kvs, key, defaultValue);
    }

    /**
     * Generic Option Getters for {@code string list type} option.
     * <p>
     * TTL configuration use {@code |} to separate items.
     * <p>
     * usage example:<br>
     * if {@code -Dfoo.list=v1|v2|v3} or
     * TTL Agent configuration is {@code -javaagent:/path/to/transmittable-thread-local-2.x.y.jar=foo.list:v1|v2|v3},
     * {@code getOptionValue("foo.list")} return {@code [v1, v2, v3]}.
     *
     * @see TtlAgent
     */
    @NonNull
    static List<String> getOptionStringListValues(@NonNull String key) {
        return TtlAgentHelper.getOptionStringListValues(kvs, key);
    }


    @SuppressFBWarnings("CT_CONSTRUCTOR_THROW")
    private TtlAgent() {
        throw new InstantiationError("Must not instantiate this class");
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/TtlAgent.java [248:382]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        return ttlAgentLoaded;
    }

    /**
     * Whether disable inheritable for thread pool is enhanced by ttl agent, check {@link #isTtlAgentLoaded()} first.
     * <p>
     * Same as {@code isBooleanOptionSet(TTL_AGENT_DISABLE_INHERITABLE_FOR_THREAD_POOL_KEY)}.
     *
     * @see com.alibaba.ttl.threadpool.TtlExecutors#getDefaultDisableInheritableThreadFactory()
     * @see com.alibaba.ttl.threadpool.TtlExecutors#getDisableInheritableThreadFactory(java.util.concurrent.ThreadFactory)
     * @see com.alibaba.ttl.threadpool.DisableInheritableThreadFactory
     * @see com.alibaba.ttl.threadpool.TtlForkJoinPoolHelper#getDefaultDisableInheritableForkJoinWorkerThreadFactory()
     * @see com.alibaba.ttl.threadpool.TtlForkJoinPoolHelper#getDisableInheritableForkJoinWorkerThreadFactory(java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory)
     * @see com.alibaba.ttl.threadpool.DisableInheritableForkJoinWorkerThreadFactory
     * @see com.alibaba.ttl.TransmittableThreadLocal
     * @see TtlAgent
     * @see #isBooleanOptionSet(String)
     * @see #TTL_AGENT_DISABLE_INHERITABLE_FOR_THREAD_POOL_KEY
     * @since 2.10.1
     */
    public static boolean isDisableInheritableForThreadPool() {
        return isBooleanOptionSet(TTL_AGENT_DISABLE_INHERITABLE_FOR_THREAD_POOL_KEY);
    }

    /**
     * Whether timer task is enhanced by ttl agent, check {@link #isTtlAgentLoaded()} first.
     * <p>
     * Same as {@code isBooleanOptionSet(TTL_AGENT_ENABLE_TIMER_TASK_KEY, true)}.
     *
     * @see java.util.Timer
     * @see java.util.TimerTask
     * @see TtlAgent
     * @see #isBooleanOptionSet(String, boolean)
     * @see #TTL_AGENT_ENABLE_TIMER_TASK_KEY
     * @since 2.10.1
     */
    public static boolean isEnableTimerTask() {
        return isBooleanOptionSet(TTL_AGENT_ENABLE_TIMER_TASK_KEY, true);
    }

    /**
     * Whether logging the transform class received by {@link TtlAgent}.
     * <p>
     * Same as {@code isBooleanOptionSet(TTL_AGENT_LOG_CLASS_TRANSFORM_KEY)}.
     *
     * @see TtlAgent
     * @see #isBooleanOptionSet(String)
     * @see #TTL_AGENT_LOG_CLASS_TRANSFORM_KEY
     * @since 3.0.0
     */
    public static boolean isLogClassTransform() {
        return isBooleanOptionSet(TTL_AGENT_LOG_CLASS_TRANSFORM_KEY);
    }

    /**
     * Get the TTL Agent Log type.
     * <p>
     * Same as {@code getStringOptionValue(TTL_AGENT_LOGGER_KEY, Logger.STDERR)}.
     *
     * @see Logger
     * @see Logger#STDERR
     * @see Logger#STDOUT
     * @see TtlAgent
     * @see #getStringOptionValue(String, String)
     * @see #TTL_AGENT_LOGGER_KEY
     * @since 3.0.0
     */
    @NonNull
    public static String getLoggerType() {
        return getStringOptionValue(TTL_AGENT_LOGGER_KEY, Logger.STDERR);
    }

    // ======== Generic Option Getters ========

    /**
     * Generic Option Getters for {@code boolean type} option.
     * <p>
     * Same as {@code isBooleanOptionSet(key, false)}.
     *
     * @see #isBooleanOptionSet(String, boolean)
     * @see TtlAgent
     * @since 3.0.0
     */
    public static boolean isBooleanOptionSet(@NonNull String key) {
        return isBooleanOptionSet(key, false);
    }

    /**
     * Generic Option Getters for {@code boolean type} option.
     *
     * @see TtlAgent
     * @since 3.0.0
     */
    public static boolean isBooleanOptionSet(@NonNull String key, boolean defaultValueIfKeyAbsent) {
        return TtlAgentHelper.isBooleanOptionSet(kvs, key, defaultValueIfKeyAbsent);
    }

    /**
     * Generic Option Getters for {@code string type} option.
     * <p>
     * usage example:
     * <p>
     * if {@code -Dttl.agent.logger=STDOUT} or
     * TTL Agent configuration is {@code -javaagent:/path/to/transmittable-thread-local-2.x.y.jar=ttl.agent.logger:STDOUT},
     * {@code getOptionValue("ttl.agent.logger")} return {@code STDOUT}.
     *
     * @see TtlAgent
     * @since 3.0.0
     */
    @NonNull
    public static String getStringOptionValue(@NonNull String key, @NonNull String defaultValue) {
        return TtlAgentHelper.getStringOptionValue(kvs, key, defaultValue);
    }

    /**
     * Generic Option Getters for {@code string list type} option.
     * <p>
     * TTL configuration use {@code |} to separate items.
     * <p>
     * usage example:<br>
     * if {@code -Dfoo.list=v1|v2|v3} or
     * TTL Agent configuration is {@code -javaagent:/path/to/transmittable-thread-local-2.x.y.jar=foo.list:v1|v2|v3},
     * {@code getOptionValue("foo.list")} return {@code [v1, v2, v3]}.
     *
     * @see TtlAgent
     */
    @NonNull
    static List<String> getOptionStringListValues(@NonNull String key) {
        return TtlAgentHelper.getOptionStringListValues(kvs, key);
    }


    @SuppressFBWarnings("CT_CONSTRUCTOR_THROW")
    private TtlAgent() {
        throw new InstantiationError("Must not instantiate this class");
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



