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

de.ppi.deepsampler.persistence.bean.DefaultPersistentBean Maven / Gradle / Ivy

There is a newer version: 2.1.0
Show newest version
/*
 * Copyright 2022 PPI AG (Hamburg, Germany)
 * This program is made available under the terms of the MIT License.
 */

package de.ppi.deepsampler.persistence.bean;

import de.ppi.deepsampler.persistence.model.PersistentBean;

import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;

public class DefaultPersistentBean implements PersistentBean {

    private Map values;

    public DefaultPersistentBean() {
        values = new LinkedHashMap<>();
    }

    public DefaultPersistentBean(final Map values) {
        this.values = new LinkedHashMap<>(values);
    }

    @Override
    public void setValues(final Map values) {
        this.values = Collections.unmodifiableMap(values);
    }

    @Override
    public Map getValues() {
        return Collections.unmodifiableMap(values);
    }

    @Override
    public Object getValue(final String key) {
        return values.get(key);
    }

    public void putValue(final String key, Object value) {
        values.put(key, value);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy