
com.cybersource.flex.sdk.CaptureContextIntentBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of flex-server-sdk Show documentation
Show all versions of flex-server-sdk Show documentation
CyberSource Flex API Server Side SDK
package com.cybersource.flex.sdk;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
public class CaptureContextIntentBuilder {
private CaptureContextIntentImpl captureContextIntent = new CaptureContextIntentImpl();
public CaptureContextIntentBuilder addTargetOrigin(String origin) {
captureContextIntent.targetOrigins.add(origin);
return this;
}
public CaptureContextIntent build() {
try {
return captureContextIntent;
} finally {
captureContextIntent = new CaptureContextIntentImpl();
}
}
private static final class CaptureContextIntentImpl implements CaptureContextIntent {
private final Set targetOrigins = new LinkedHashSet<>();
@Override
public Set getTargetOrigins() {
return Collections.unmodifiableSet(targetOrigins);
}
@Override
public String toString() {
final StringBuilder retVal = new StringBuilder();
retVal
.append("Intent{")
.append("targetOrigins=")
.append(getTargetOrigins())
.append("}");
return retVal.toString();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy