/** * Simple builder */ public static NameDescription nd(String name, String description) { return new NameDescription(name, description); }
public NameDescription asNameDescription() { return new NameDescription(name, description); } }
public static NameDescription nameDescription() { String uid = uid(""); return new NameDescription( uid, String.format("%s description", uid) ); }
protected PredefinedPromotionLevel toPredefinedPromotionLevel(ResultSet rs) throws SQLException { return PredefinedPromotionLevel.of( new NameDescription( rs.getString("name"), rs.getString("description") ) ).withId(id(rs)).withImage(StringUtils.isNotBlank(rs.getString("imagetype"))); } }
protected PredefinedValidationStamp toPredefinedValidationStamp(ResultSet rs) throws SQLException { return PredefinedValidationStamp.of( new NameDescription( rs.getString("name"), rs.getString("description") ) ) .withId(id(rs)) .withDataType(validationDataTypeConfigRepository.readValidationDataTypeConfig(rs)) .withImage(StringUtils.isNotBlank(rs.getString("imagetype"))); } }
protected PromotionLevel toPromotionLevel(ResultSet rs, Function<ID, Branch> branchSupplier) throws SQLException { return PromotionLevel.of( branchSupplier.apply(id(rs, "branchId")), new NameDescription( rs.getString("name"), rs.getString("description") ) ).withId(id(rs)) .withSignature(readSignature(rs)) .withImage(StringUtils.isNotBlank(rs.getString("imagetype"))); }
protected Build toBuild(ResultSet rs, Function<ID, Branch> branchSupplier) throws SQLException { return Build.of( branchSupplier.apply(id(rs, "branchId")), new NameDescription( rs.getString("name"), rs.getString("description") ), readSignature(rs) ).withId(id(rs)); }
protected Project toProject(ResultSet rs) throws SQLException { return Project.of(new NameDescription( rs.getString("name"), rs.getString("description") )) .withId(id(rs.getInt("id"))) .withSignature(readSignature(rs)) .withDisabled(rs.getBoolean("disabled")); }
protected ValidationStamp toValidationStamp( ResultSet rs, Function<ID, Branch> branchSupplier ) throws SQLException { return ValidationStamp.of( branchSupplier.apply(id(rs, "branchId")), new NameDescription( rs.getString("name"), rs.getString("description") ) ).withId(id(rs)) .withSignature(readSignature(rs)) .withDataType(validationDataTypeConfigRepository.readValidationDataTypeConfig(rs)) .withImage(StringUtils.isNotBlank(rs.getString("imagetype"))); }
protected Branch toBranch(ResultSet rs, Function<ID, Project> projectSupplier) throws SQLException { ID projectId = id(rs, "projectId"); ID branchId = id(rs); return Branch.of( projectSupplier.apply(projectId), new NameDescription( rs.getString("name"), rs.getString("description") ) ) .withId(branchId) .withSignature(readSignature(rs)) .withType(getBranchType(branchId)) .withDisabled(rs.getBoolean("disabled")); }
private Build doCreateBuild(Branch branch, TCopyEvent copy, String buildName, SVNRepository repository) { // The build date is assumed to be the creation of the tag SVNRevisionInfo revisionInfo = svnService.getRevisionInfo(repository, copy.getRevision()); LocalDateTime revisionTime = revisionInfo.getDateTime(); // Creation of the build return structureService.newBuild( Build.of( branch, new NameDescription( buildName, String.format("Build created by SVN synchronisation from tag %s", copy.getCopyToPath()) ), securityService.getCurrentSignature().withTime(revisionTime) ) ); }