public static PromotionLevel of(Branch branch, NameDescription nameDescription) { Entity.isEntityDefined(branch, "Branch must be defined"); Entity.isEntityDefined(branch.getProject(), "Project must be defined"); return new PromotionLevel(ID.NONE, nameDescription.getName(), nameDescription.getDescription(), branch, false, Signature.none() ); }
protected Branch createBranchForTemplateInstance(Branch templateBranch, String branchName) { return structureService.newBranch( Branch.of( templateBranch.getProject(), NameDescription.nd( NameDescription.escapeName(branchName), "" ) ) ); }
protected <T> void doCopyProperty(ProjectEntity sourceEntity, Property<T> property, ProjectEntity targetEntity, Function<String, String> replacementFn) { if (!property.isEmpty() && property.getType().canEdit(targetEntity, securityService)) { // Copy of the property propertyService.copyProperty( sourceEntity, property, targetEntity, replacementFn ); } }
/** * Tests if a property is defined. */ default <T> boolean hasProperty(ProjectEntity entity, Class<? extends PropertyType<T>> propertyTypeClass) { return !getProperty(entity, propertyTypeClass).isEmpty(); }
public static ValidationStamp of(Branch branch, NameDescription nameDescription) { Entity.isEntityDefined(branch, "Branch must be defined"); Entity.isEntityDefined(branch.getProject(), "Project must be defined"); return new ValidationStamp( ID.NONE, nameDescription.getName(), nameDescription.getDescription(), branch, null, false, Signature.none(), null ); }
@Override public boolean isDisabled() { return branch.isDisabled() || branch.getProject().isDisabled(); }
public Build update(NameDescription nameDescription) { return new Build( id, nameDescription.getName(), nameDescription.getDescription(), signature, branch ); } }
public PredefinedValidationStamp update(NameDescription nameDescription) { return new PredefinedValidationStamp( id, nameDescription.getName(), nameDescription.getDescription(), image, dataType ); } }
public PromotionLevel update(NameDescription nameDescription) { return new PromotionLevel( id, nameDescription.getName(), nameDescription.getDescription(), branch, image, signature ); } }
public PredefinedPromotionLevel update(NameDescription nameDescription) { return new PredefinedPromotionLevel( id, nameDescription.getName(), nameDescription.getDescription(), image ); } }
public ValidationStamp update(NameDescription nameDescription) { return new ValidationStamp( id, nameDescription.getName(), nameDescription.getDescription(), branch, owner, image, signature, dataType ); } }
public static Branch of(Project project, NameDescriptionState nameDescription) { return new Branch( ID.NONE, nameDescription.getName(), nameDescription.getDescription(), nameDescription.isDisabled(), BranchType.CLASSIC, project, Signature.none() ); }
public static Project of(NameDescriptionState nameDescription) { return new Project(ID.NONE, nameDescription.getName(), nameDescription.getDescription(), nameDescription.isDisabled(), Signature.none()); }
default Description toDescription() { return new Description( getId(), getName(), getDescription() ); }
/** * Gets the last status of the last run, or <code>null</code> if no run has been performed. */ public ValidationRunStatus getLastStatus() { ValidationRun run = getLastRun(); if (run == null) { return null; } else { return run.getLastStatus(); } }
@Override public String getItemId(Property<?> item) { return item.getType().getTypeName(); }
public static Build of(Branch branch, NameDescription nameDescription, Signature signature) { return new Build( ID.NONE, nameDescription.getName(), nameDescription.getDescription(), signature, branch ); }