diff --git a/external-sop/src/main/java/sop/external/operation/VersionExternal.java b/external-sop/src/main/java/sop/external/operation/VersionExternal.java index 3b21792..0b9c5b4 100644 --- a/external-sop/src/main/java/sop/external/operation/VersionExternal.java +++ b/external-sop/src/main/java/sop/external/operation/VersionExternal.java @@ -101,7 +101,7 @@ public class VersionExternal implements Version { } @Override - public int getSopSpecVersionNumber() { + public int getSopSpecRevisionNumber() { String revision = getSopSpecVersion(); String firstLine; if (revision.contains("\n")) { @@ -124,7 +124,7 @@ public class VersionExternal implements Version { } @Override - public String getSopSpecImplementationIncompletenessRemarks() { + public String getSopSpecImplementationRemarks() { String revision = getSopSpecVersion(); if (revision.contains("\n")) { String tail = revision.substring(revision.indexOf("\n") + 1).trim(); diff --git a/sop-java/src/main/java/sop/operation/Version.java b/sop-java/src/main/java/sop/operation/Version.java index 95b2fe1..b6d66b9 100644 --- a/sop-java/src/main/java/sop/operation/Version.java +++ b/sop-java/src/main/java/sop/operation/Version.java @@ -47,37 +47,6 @@ public interface Version { */ String getExtendedVersion(); - /** - * Return the version number of the latest targeted SOP spec revision. - * - * @return SOP spec revision number - */ - int getSopSpecVersionNumber(); - - /** - * Return the latest targeted revision of the SOP spec. - * - * @return SOP spec revision string - */ - default String getSopSpecRevisionString() { - return "draft-dkg-openpgp-stateless-cli-" + String.format("%02d", getSopSpecVersionNumber()); - } - - /** - * Return
true, if this implementation of the SOP spec is known to be incomplete or defective. - * - * @return true if incomplete, false otherwise - */ - boolean isSopSpecImplementationIncomplete(); - - /** - * Return free-form text containing remarks about the completeness of the SOP implementation. - * If no remarks are known, this method returns
null. - * - * @return remarks or null - */ - String getSopSpecImplementationIncompletenessRemarks(); - /** * Return the revision of the SOP specification that this implementation is implementing, for example, *
draft-dkg-openpgp-stateless-cli-06. @@ -95,14 +64,46 @@ public interface Version { sb.append('~'); } - sb.append(getSopSpecRevisionString()); + sb.append(getSopSpecRevisionName()); - if (getSopSpecImplementationIncompletenessRemarks() != null) { + if (getSopSpecImplementationRemarks() != null) { sb.append('\n') .append('\n') - .append(getSopSpecImplementationIncompletenessRemarks()); + .append(getSopSpecImplementationRemarks()); } return sb.toString(); } + + /** + * Return the version number of the latest targeted SOP spec revision. + * + * @return SOP spec revision number + */ + int getSopSpecRevisionNumber(); + + /** + * Return the name of the latest targeted revision of the SOP spec. + * + * @return SOP spec revision string + */ + default String getSopSpecRevisionName() { + return "draft-dkg-openpgp-stateless-cli-" + String.format("%02d", getSopSpecRevisionNumber()); + } + + /** + * Return
true, if this implementation of the SOP spec is known to be incomplete or defective. + * + * @return true if incomplete, false otherwise + */ + boolean isSopSpecImplementationIncomplete(); + + /** + * Return free-form text containing remarks about the completeness of the SOP implementation. + * If there are no remarks, this method returns
null. + * + * @return remarks or null + */ + String getSopSpecImplementationRemarks(); + } diff --git a/sop-java/src/testFixtures/java/sop/testsuite/operation/VersionTest.java b/sop-java/src/testFixtures/java/sop/testsuite/operation/VersionTest.java index 59208dc..73ba571 100644 --- a/sop-java/src/testFixtures/java/sop/testsuite/operation/VersionTest.java +++ b/sop-java/src/testFixtures/java/sop/testsuite/operation/VersionTest.java @@ -69,7 +69,7 @@ public class VersionTest extends AbstractSOPTest { assertTrue(sopSpec.startsWith("draft-dkg-openpgp-stateless-cli-")); } - int sopRevision = sop.version().getSopSpecVersionNumber(); - assertTrue(sop.version().getSopSpecRevisionString().endsWith("" + sopRevision)); + int sopRevision = sop.version().getSopSpecRevisionNumber(); + assertTrue(sop.version().getSopSpecRevisionName().endsWith("" + sopRevision)); } }