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

org.sahagin.share.srctree.code.StringCode Maven / Gradle / Ivy

The newest version!
package org.sahagin.share.srctree.code;

import java.util.Map;

import org.sahagin.share.yaml.YamlConvertException;
import org.sahagin.share.yaml.YamlUtils;

public class StringCode extends Code {
    public static final String TYPE = "string";

    private String value;

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Override
    protected String getType() {
        return TYPE;
    }

    @Override
    public Map toYamlObject() {
        Map result = super.toYamlObject();
        result.put("value", value);
        return result;
    }

    @Override
    public void fromYamlObject(Map yamlObject)
            throws YamlConvertException {
        super.fromYamlObject(yamlObject);
        value = YamlUtils.getStrValue(yamlObject, "value");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy