net.nemerosa.ontrack.model.support.UserPasswordConfiguration 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 com.fasterxml.jackson.annotation.JsonIgnore;
import org.apache.commons.lang3.StringUtils;
import java.util.Optional;
import java.util.function.Function;
public interface UserPasswordConfiguration> extends Configuration {
/**
* Name of the configuration
*/
String getName();
String getUser();
String getPassword();
T withPassword(String password);
T clone(String targetConfigurationName, Function replacementFunction);
@JsonIgnore
default Optional getCredentials() {
String user = getUser();
if (StringUtils.isNotBlank(user)) {
return Optional.of(new UserPassword(user, getPassword()));
} else {
return Optional.empty();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy