public NameDescription asNameDescription() { return NameDescription.nd(name, description); } }
/** * Simple builder */ public static NameDescription nd(String name, String description) { return new NameDescription(name, description); }
public PromotionLevel update(NameDescription nameDescription) { return new PromotionLevel( id, nameDescription.getName(), nameDescription.getDescription(), branch, image, signature ); } }
protected Branch createBranchForTemplateInstance(Branch templateBranch, String branchName) { return structureService.newBranch( Branch.of( templateBranch.getProject(), NameDescription.nd( NameDescription.escapeName(branchName), "" ) ) ); }
@Override public List<ApplicationInfo> getApplicationInfoList() { if (securityService.isGlobalFunctionGranted(ApplicationManagement.class)) { return logService.getLogEntries( new ApplicationLogEntryFilter().withLevel(ApplicationLogEntryLevel.FATAL), new Page(0, configProperties.getApplicationLogInfoMax()) ) .stream() .map(lge -> ApplicationInfo.error( lge.getType().getDescription() )) .collect(Collectors.toList()); } else { return Collections.emptyList(); } } }
public NameDescriptionState asState() { return asState(false); }
public static Branch of(Project project, NameDescription nameDescription) { return of(project, nameDescription.asState()); }
public List<NameDescription> getDetailList() { return details.entrySet().stream() .map(entry -> NameDescription.nd(entry.getKey(), entry.getValue())) .collect(Collectors.toList()); }
public PredefinedPromotionLevel update(NameDescription nameDescription) { return new PredefinedPromotionLevel( id, nameDescription.getName(), nameDescription.getDescription(), image ); } }
public NameDescription asNameDescription() { return new NameDescription(name, description); } }
public ValidationRun doValidateBuild(Build build, String vsName, ValidationRunStatusID statusId) throws Exception { ValidationStamp vs = doCreateValidationStamp(build.getBranch(), NameDescription.nd(vsName, "")); return doValidateBuild(build, vs, statusId); }
public Build update(NameDescription nameDescription) { return new Build( id, nameDescription.getName(), nameDescription.getDescription(), signature, branch ); } }
public static NameDescription nameDescription() { String uid = uid(""); return new NameDescription( uid, String.format("%s description", uid) ); }
@Override public <T extends ProjectEntity> List<LinkDefinition<T>> getLinkDefinitions(ProjectEntityType projectEntityType) { List<LinkDefinition<T>> definitions = new ArrayList<>(); contributors.forEach(contributor -> { if (contributor.applyTo(projectEntityType)) { try { @SuppressWarnings("unchecked") ResourceDecorationContributor<T> tResourceDecorationContributor = (ResourceDecorationContributor<T>) contributor; definitions.addAll(tResourceDecorationContributor.getLinkDefinitions()); } catch (Exception ex) { // Logging logService.log( ApplicationLogEntry.fatal( ex, NameDescription.nd( "ui-resource-decoration", "Issue when collecting UI resource decoration" ), contributor.getClass().getName() ) .withDetail("ui-resource-type", projectEntityType.name()) .withDetail("ui-resource-decorator", contributor.getClass().getName()) ); } } }); return definitions; } }
public PredefinedValidationStamp update(NameDescription nameDescription) { return new PredefinedValidationStamp( id, nameDescription.getName(), nameDescription.getDescription(), image, dataType ); } }
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"))); } }
@Override public void createTargetItem(PromotionLevel sourcePromotionLevel) { PromotionLevel targetPromotionLevel = structureService.newPromotionLevel( PromotionLevel.of( targetBranch, NameDescription.nd( sourcePromotionLevel.getName(), replacementFn.apply(sourcePromotionLevel.getDescription()) ) ) ); copyPromotionLevelContent(sourcePromotionLevel, targetPromotionLevel); }
public static Build of(Branch branch, NameDescription nameDescription, Signature signature) { return new Build( ID.NONE, nameDescription.getName(), nameDescription.getDescription(), signature, branch ); }
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"))); } }
@Override public void createTargetItem(ValidationStamp sourceValidationStamp) { ValidationStamp targetValidationStamp = structureService.newValidationStamp( ValidationStamp.of( targetBranch, NameDescription.nd( sourceValidationStamp.getName(), replacementFn.apply(sourceValidationStamp.getDescription()) ) ) ); copyValidationStampContent(sourceValidationStamp, targetValidationStamp); }