com.atlassian.bamboo.specs.api.model.owner.PlanOwnerProperties Maven / Gradle / Ivy
The newest version!
package com.atlassian.bamboo.specs.api.model.owner;
import com.atlassian.bamboo.specs.api.builders.owner.PlanOwner;
import com.atlassian.bamboo.specs.api.codegen.annotations.Builder;
import com.atlassian.bamboo.specs.api.codegen.annotations.CodeGenerator;
import com.atlassian.bamboo.specs.api.model.AtlassianModuleProperties;
import com.atlassian.bamboo.specs.api.model.plan.configuration.PluginConfigurationProperties;
import com.atlassian.bamboo.specs.api.validators.common.ImporterUtils;
import com.atlassian.bamboo.specs.api.validators.common.ValidationContext;
import com.atlassian.bamboo.specs.codegen.emitters.owner.PlanOwnerEmitter;
import java.util.Objects;
@Builder(PlanOwner.class)
@CodeGenerator(PlanOwnerEmitter.class)
public class PlanOwnerProperties implements PluginConfigurationProperties {
public static final ValidationContext VALIDATION_CONTEXT = ValidationContext.of("Plan Ownership");
public static final String OWNER_OF_PLAN = "custom.planownership.bamboo.plugin.plan.config.ownerOfBuild";
private String owner;
private PlanOwnerProperties() {}
public PlanOwnerProperties(String owner) {
this.owner = owner;
}
public String getOwner() {
return owner;
}
@Override
public AtlassianModuleProperties getAtlassianPlugin() {
return new AtlassianModuleProperties("com.atlassian.buildeng.bamboo-plan-ownership:ownership");
}
@Override
public final void validate() {
ImporterUtils.checkNotBlank(VALIDATION_CONTEXT, "owner", owner);
}
@Override
public int hashCode() {
int hash = 7;
hash = 79 * hash + Objects.hashCode(this.owner);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final PlanOwnerProperties other = (PlanOwnerProperties) obj;
return Objects.equals(this.owner, other.owner);
}
}