@Test public void getRevision_numeric() { assertEquals( OptionalLong.of(1234L), link.getRevision( NoConfig.INSTANCE, Build.of( Branch.of( Project.of(nd("P", "")), nd("B", "") ), nd("1234", ""), Signature.of("test") ), branchConfigurationProperty ) ); }
@Override public OptionalLong getRevision(NoConfig data, Build build, SVNBranchConfigurationProperty branchConfigurationProperty) { if (StringUtils.isNumeric(build.getName())) { return OptionalLong.of(Long.parseLong(build.getName(), 10)); } else { return OptionalLong.empty(); } }
RevisionSvnRevisionLink implements BuildSvnRevisionLink<NoConfig> { @Override public OptionalLong getRevision(NoConfig data, Build build, SVNBranchConfigurationProperty branchConfigurationProperty) { if (StringUtils.isNumeric(build.getName())) { return OptionalLong.of(Long.parseLong(build.getName(), 10)); } else { return OptionalLong.empty(); } } }
RevisionSvnRevisionLink implements BuildSvnRevisionLink<NoConfig> { @Override public OptionalLong getRevision(NoConfig data, Build build, SVNBranchConfigurationProperty branchConfigurationProperty) { if (StringUtils.isNumeric(build.getName())) { return OptionalLong.of(Long.parseLong(build.getName(), 10)); } else { return OptionalLong.empty(); } } @Autowired  RevisionSvnRevisionLink(StructureService structureService); }
RevisionSvnRevisionLink implements BuildSvnRevisionLink<NoConfig> { @Override public OptionalLong getRevision(NoConfig data, Build build, SVNBranchConfigurationProperty branchConfigurationProperty) { if (StringUtils.isNumeric(build.getName())) { return OptionalLong.of(Long.parseLong(build.getName(), 10)); } else { return OptionalLong.empty(); } } @Autowired  RevisionSvnRevisionLink(StructureService structureService); @Override String getId(); @Override String getName(); @Override NoConfig clone(NoConfig data, Function<String, String> replacementFunction); @Override NoConfig parseData(JsonNode node); @Override JsonNode toJson(NoConfig data); @Override Form getForm(); @Override boolean isValidBuildName(NoConfig data, String name); @Override OptionalLong getRevision(NoConfig data, Build build, SVNBranchConfigurationProperty branchConfigurationProperty); @Override String getBuildPath(NoConfig data, Build build, SVNBranchConfigurationProperty branchConfigurationProperty); @Override Optional<Build> getEarliestBuild(NoConfig data, Branch branch, SVNLocation location, SVNLocation firstCopy, SVNBranchConfigurationProperty branchConfigurationProperty); }
RevisionSvnRevisionLink implements BuildSvnRevisionLink<NoConfig> { @Override public OptionalLong getRevision(NoConfig data, Build build, SVNBranchConfigurationProperty branchConfigurationProperty) { if (StringUtils.isNumeric(build.getName())) { return OptionalLong.of(Long.parseLong(build.getName(), 10)); } else { return OptionalLong.empty(); } } @Autowired  RevisionSvnRevisionLink(StructureService structureService); @Override String getId(); @Override String getName(); @Override NoConfig clone(NoConfig data, Function<String, String> replacementFunction); @Override NoConfig parseData(JsonNode node); @Override JsonNode toJson(NoConfig data); @Override Form getForm(); @Override boolean isValidBuildName(NoConfig data, String name); @Override OptionalLong getRevision(NoConfig data, Build build, SVNBranchConfigurationProperty branchConfigurationProperty); @Override String getBuildPath(NoConfig data, Build build, SVNBranchConfigurationProperty branchConfigurationProperty); @Override Optional<Build> getEarliestBuild(NoConfig data, Branch branch, SVNLocation location, SVNLocation firstCopy, SVNBranchConfigurationProperty branchConfigurationProperty);  }