com.yoti.api.client.shareurl.constraint.SourceConstraint Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yoti-sdk-api Show documentation
Show all versions of yoti-sdk-api Show documentation
Java SDK for simple integration with the Yoti platform
The newest version!
package com.yoti.api.client.shareurl.constraint;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.yoti.api.client.shareurl.policy.WantedAnchor;
import com.fasterxml.jackson.annotation.JsonProperty;
public class SourceConstraint implements Constraint {
@JsonProperty("type")
private static final String type = ConstraintConstants.SOURCE_CONSTRAINT;
@JsonProperty("preferred_sources")
private final PreferredSources preferredSources;
SourceConstraint(List wantedAnchors, boolean softPreference) {
this.preferredSources = new PreferredSources(wantedAnchors, softPreference);
}
public static SourceConstraint.Builder builder() {
return new SourceConstraint.Builder();
}
@Override
public String getType() {
return type;
}
public PreferredSources getPreferredSources() {
return preferredSources;
}
public static class Builder {
private final List wantedAnchors;
private boolean softPreference;
private Builder() {
this.wantedAnchors = new ArrayList<>();
this.softPreference = false;
}
public Builder withWantedAnchor(WantedAnchor wantedAnchor) {
this.wantedAnchors.add(wantedAnchor);
return this;
}
public Builder withSoftPreference(boolean softPreference) {
this.softPreference = softPreference;
return this;
}
public SourceConstraint build() {
return new SourceConstraint(
Collections.unmodifiableList(wantedAnchors),
softPreference
);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy