net.nemerosa.ontrack.model.extension.ExtensionFeatureOptions 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.extension;
import lombok.Data;
import lombok.experimental.Builder;
import lombok.experimental.Wither;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
/**
* Options for a feature
*/
@Data
@Builder
public class ExtensionFeatureOptions {
/**
* Default options
*/
public static final ExtensionFeatureOptions DEFAULT = builder()
.gui(false)
.dependencies(Collections.emptySet())
.build();
/**
* Does the extension provides some web components?
*/
@Wither
private final boolean gui;
/**
* List of extensions IDs this feature depends on.
*/
@Wither
private final Set dependencies;
/**
* Adds a dependency
*/
public ExtensionFeatureOptions withDependency(ExtensionFeature feature) {
Set existing = this.dependencies;
Set newDependencies;
if (existing == null) {
newDependencies = new HashSet<>();
} else {
newDependencies = new HashSet<>(existing);
}
newDependencies.add(feature.getId());
return withDependencies(newDependencies);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy