+ String getVersion();
+
+ /**
+ * The forward compatible branch of this version, by default it is
+ * [major].[minor].
+ */
+ default String getBranch() {
+ String[] parts = getVersion().split("\\.");
+ if (parts.length < 2)
+ throw new IllegalStateException("Version " + getVersion() + " cannot be interpreted as branch.");
+ return parts[0] + "." + parts[1];
+ }