File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
spring-batch-core/src/main/java/org/springframework/batch/core/job Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2006-2022 the original author or authors.
2+ * Copyright 2006-2025 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
2828 * @author Dave Syer
2929 * @author Mahmoud Ben Hassine
3030 */
31+ @ FunctionalInterface
3132public interface Job {
3233
33- String getName ();
34+ /**
35+ * The name of the job. This is used to distinguish between different jobs and must be
36+ * unique within the job repository. If not explicitly set, the name will default to
37+ * the fully qualified class name.
38+ * @return the name of the job (never {@code null})
39+ */
40+ default String getName () {
41+ return this .getClass ().getName ();
42+ }
3443
3544 /**
3645 * Flag to indicate if this job can be restarted, at least in principle.
You can’t perform that action at this time.
0 commit comments