package ru.yandex.webmaster3.storage.util.yt.spring;

import java.beans.PropertyEditorSupport;

import ru.yandex.webmaster3.storage.util.yt.YtPath;

/**
 * @author aherman
 */
public class YtPathPropertyEditor extends PropertyEditorSupport {
    @Override
    public void setAsText(String text) throws IllegalArgumentException {
        setValue(YtPath.fromString(text));
    }

    @Override
    public String getAsText() {
        Object value = getValue();
        return value != null ? value.toString() : "";
    }
}
