All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.hypertrack.model.HyperTrackModel Maven / Gradle / Ivy

There is a newer version: 1.0.1
Show newest version
package io.hypertrack.model;

import com.google.gson.Gson;

import java.util.Map;

/**
 * Created by Arjun on 18/04/16.
 */
public abstract class HyperTrackModel {
    private Map properties;

    protected HyperTrackModel() {
        this(null);
    }

    protected HyperTrackModel(final Map properties) {
        this.properties = properties;
    }

    public Boolean existsProperty(String key) {
        return properties.containsKey(key);
    }

    public String getProperties() {
        Gson gson = new Gson();
        return gson.toJson(this.properties);
    }

    public Object getProperty(String key) {
        return properties.get(key);
    }

    public void setProperties(Map map) {
        this.properties = map;
    }

    public void setProperty(String key, Object value) {
        this.properties.put(key, value);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy