mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-11-18 21:42:05 +01:00
Rename new methods in Version
This commit is contained in:
parent
1a4affde35
commit
84a01df4bd
3 changed files with 39 additions and 38 deletions
|
@ -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();
|
||||
|
|
|
@ -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 <pre>true</pre>, 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 <pre>null</pre>.
|
||||
*
|
||||
* @return remarks or null
|
||||
*/
|
||||
String getSopSpecImplementationIncompletenessRemarks();
|
||||
|
||||
/**
|
||||
* Return the revision of the SOP specification that this implementation is implementing, for example,
|
||||
* <pre>draft-dkg-openpgp-stateless-cli-06</pre>.
|
||||
|
@ -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 <pre>true</pre>, 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 <pre>null</pre>.
|
||||
*
|
||||
* @return remarks or null
|
||||
*/
|
||||
String getSopSpecImplementationRemarks();
|
||||
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue