prompto.value.IValue Maven / Gradle / Ivy
The newest version!
package prompto.value;
import java.lang.reflect.Type;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.ObjectNode;
import prompto.error.NotStorableError;
import prompto.error.PromptoError;
import prompto.grammar.Identifier;
import prompto.intrinsic.PromptoDbId;
import prompto.runtime.Context;
import prompto.store.DataStore;
import prompto.store.IStorable;
import prompto.type.IType;
/** IValue is a wrapper around intrinsic or primitive values
* which helps expose an API for the interpreter
*/
public interface IValue {
@SuppressWarnings("unchecked")
public static int compareValues(IValue v1, IValue v2) {
if(v1==null && v2==null)
return 0;
else if(v1==null)
return -1;
else if(v2==null)
return 1;
else if(v1 instanceof Comparable)
return ((Comparable
© 2015 - 2024 Weber Informatics LLC | Privacy Policy