net.nemerosa.ontrack.model.support.AbstractBranchJob Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-model Show documentation
Show all versions of ontrack-model Show documentation
Ontrack module: ontrack-model
package net.nemerosa.ontrack.model.support;
import net.nemerosa.ontrack.job.Job;
import net.nemerosa.ontrack.model.structure.Branch;
import net.nemerosa.ontrack.model.structure.StructureService;
public abstract class AbstractBranchJob implements Job {
private final StructureService structureService;
private final Branch branch;
protected AbstractBranchJob(StructureService structureService, Branch branch) {
this.structureService = structureService;
this.branch = branch;
}
@Override
public boolean isDisabled() {
return branch.isDisabled() || branch.getProject().isDisabled();
}
@Override
public boolean isValid() {
return structureService.findBranchByName(branch.getProject().getName(), branch.getName()).isPresent();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy