com.podio.contact.ProfileFieldValues Maven / Gradle / Ivy
package com.podio.contact;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.codehaus.jackson.annotate.JsonValue;
public final class ProfileFieldValues {
private Map, Object> values = new HashMap, Object>();
@JsonValue
public Map, Object> getValues() {
return values;
}
public void setValues(Map, Object> values) {
this.values = values;
}
public void setValue(ProfileField field, F value) {
if (field.isSingle()) {
values.put(field, value);
} else {
values.put(field, Collections.singletonList(value));
}
}
public F getValue(ProfileField field) {
if (field.isSingle()) {
return (F) values.get(field);
} else {
List