/** * Wraps the provided string as a {@code JobRunnerKey}. * <p> * Although it is not necessary for correctness, it will usually make sense to create a single instance of * the {@code JobRunnerKey} and reuse it as a constant, as in: * </p> * <pre><code> * private static final JobRunnerKey <strong>POP3_SERVICE</strong> = JobRunnerKey.of("com.example.plugin.Pop3Service"); * * // ... * * private void registerJobRunner() * { * schedulerService.registerJobRunner(<strong>POP3_SERVICE</strong>, new Pop3JobRunner()); * } * * private String scheduleJobWithGeneratedId(String cronExpression) * { * JobConfig jobConfig = JobConfig.forJobRunnerKey(<strong>POP3_SERVICE</strong>) * .withSchedule(Schedule.forCronExpression(cronExpression)); * return schedulerService.scheduleJobWithGeneratedId(jobConfig); * } * </code></pre> * * @param key the job runner key, as a string * @return the wrapped job runner key */ public static JobRunnerKey of(String key) { return new JobRunnerKey(key); }