
org.infobip.mobile.messaging.api.support.MapModel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infobip-mobile-messaging-api-java Show documentation
Show all versions of infobip-mobile-messaging-api-java Show documentation
Mobile Messaging SDK for Android
The newest version!
package org.infobip.mobile.messaging.api.support;
import org.infobip.mobile.messaging.api.support.http.serialization.JsonSerializer;
import java.util.HashMap;
import java.util.Map;
public class MapModel {
private static final JsonSerializer nullSerializer = new JsonSerializer(true);
private final Map map = new HashMap<>();
public Map getMap() {
return map;
}
public T getField(String name) {
//noinspection unchecked
return (T) map.get(name);
}
public void setField(String name, T value) {
map.put(name, value);
}
public boolean containsField(String name) {
return map.containsKey(name);
}
public boolean hasDataToReport() {
return !map.isEmpty();
}
public void clearUnreportedData() {
map.clear();
}
@Override
public String toString() {
return nullSerializer.serialize(map);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy