package org.traccar.model; import java.util.LinkedHashMap; import java.util.Map; public class Extensible { private long id; public long getId() { return id; } public void setId(long id) { this.id = id; } private Map attributes = new LinkedHashMap<>(); public Map getAttributes() { return attributes; } public void setAttributes(Map attributes) { this.attributes = attributes; } public void set(String key, boolean value) { attributes.put(key, value); } public void set(String key, int value) { attributes.put(key, value); } public void set(String key, long value) { attributes.put(key, value); } public void set(String key, double value) { attributes.put(key, value); } public void set(String key, String value) { if (value != null && !value.isEmpty()) { attributes.put(key, value); } } public void add(Map.Entry entry) { if (entry != null && entry.getValue() != null) { attributes.put(entry.getKey(), entry.getValue()); } } }