Skip to content

Commit

Permalink
Use collection for credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
pfeuffer committed May 17, 2021
1 parent 37d2e1b commit 7939ae4
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -27,19 +27,19 @@
import org.apache.commons.lang.StringUtils;
import sonia.scm.repository.api.Credential;

import java.util.List;
import java.util.Collection;
import java.util.Optional;

import static java.util.Collections.emptyList;
import static java.util.Collections.unmodifiableList;
import static java.util.Collections.unmodifiableCollection;

/**
* @since 2.19.0
*/
public final class MirrorCommandRequest {

private String sourceUrl;
private List<Credential> credentials = emptyList();
private Collection<Credential> credentials = emptyList();

public String getSourceUrl() {
return sourceUrl;
Expand All @@ -49,8 +49,8 @@ public void setSourceUrl(String sourceUrl) {
this.sourceUrl = sourceUrl;
}

public List<Credential> getCredentials() {
return unmodifiableList(credentials);
public Collection<Credential> getCredentials() {
return unmodifiableCollection(credentials);
}

public <T extends Credential> Optional<T> getCredential(Class<T> credentialClass) {
Expand All @@ -61,7 +61,7 @@ public <T extends Credential> Optional<T> getCredential(Class<T> credentialClass
.findFirst();
}

public void setCredentials(List<Credential> credentials) {
public void setCredentials(Collection<Credential> credentials) {
this.credentials = credentials;
}

Expand Down

0 comments on commit 7939ae4

Please sign in to comment.