Package io.lumify.core.model.properties.types

Source Code of io.lumify.core.model.properties.types.DetectedObjectProperty

package io.lumify.core.model.properties.types;

import io.lumify.core.ingest.ArtifactDetectedObject;
import org.json.JSONObject;

public class DetectedObjectProperty extends LumifyProperty<ArtifactDetectedObject, String> {
    public DetectedObjectProperty(String key) {
        super(key);
    }

    @Override
    public String wrap(ArtifactDetectedObject value) {
        return value.toJson().toString();
    }

    @Override
    public ArtifactDetectedObject unwrap(Object value) {
        if (value == null) {
            return null;
        }
        return new ArtifactDetectedObject(new JSONObject(value.toString()));
    }
}
TOP

Related Classes of io.lumify.core.model.properties.types.DetectedObjectProperty

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.