public static final java.lang.String |
JAVA_SERVICE_TEMPLATE |
"// This class is automatically created by %5$s.\n%1$s;\nimport de.caff.annotation.NotNull;\nimport de.caff.generics.Types;\nimport de.caff.version.ModuleVersionService;\nimport de.caff.version.SemVer;\n\nimport java.util.Objects;\n\n/**\n * Module version information.\n * This automatically created class provides version information for the module in which it is contained.\n * Note that creating this class is only the first step, it is necessary to include it in the\n * META-INF/services directory in the module\'s jar.\n */\npublic class %2$s\n implements ModuleVersionService\n{\n /** Module name. */\n @NotNull\n public static final String MODULE_NAME = \"%3$s\";\n /** Module version as a constant. */\n @NotNull\n public static final SemVer VERSION = Objects.requireNonNull(SemVer.parse(\"%4$s\"));\n\n @NotNull\n @Override\n public String getModuleName()\n {\n return MODULE_NAME;\n }\n\n @NotNull\n @Override\n public SemVer getModuleVersion()\n {\n return VERSION;\n }\n\n /**\n * Get the release date.\n * This assumes that the release date is included in {@link #VERSION} as build string.\n * @return build string of the version, empty if there is none\n */\n @NotNull\n public static String getReleaseDate()\n {\n return Types.notNull(VERSION.getBuildString());\n }\n\n @NotNull\n @Override\n public String toString()\n {\n return String.format(\"%%s: %%s\", MODULE_NAME, VERSION);\n }\n}\n" |