uk.gov.service.payments.commons.model.charge.ExternalMetadata Maven / Gradle / Ivy
package uk.gov.service.payments.commons.model.charge;
import uk.gov.service.payments.commons.api.validation.ValidExternalMetadata;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
public class ExternalMetadata {
public static final int MAX_KEY_VALUE_PAIRS = 15;
public static final int MIN_KEY_LENGTH = 1;
public static final int MAX_KEY_LENGTH = 30;
public static final int MAX_VALUE_LENGTH = 100;
@ValidExternalMetadata
private final Map metadata;
public ExternalMetadata(Map metadata) {
this.metadata = new HashMap<>(metadata);
}
public Map getMetadata() {
return Collections.unmodifiableMap(metadata);
}
}