Lookup Context

A digital twin storage space for faster storage and retrieval of custom data

A simple but powerful interface to access the underlying big-data storage for setting and getting the meta-data associated with an entity object ( platform meta models)

Values can be stored as simple name value pair of strings or original datatypes like int, bool, etc..

/**
     * Retrieve a stored property, return data is formatted if a format is specified while storing
     * @return null if not found
     */
    public Object property(String name);
    
    /**
     * Retrieve a stored property, return data is formatted if a format is specified while storing
     * @return def value if not found
     */
    public Object getProperty(String name, String def);
    
    /**
     * Store a named property
     */
    public void property(String name, String value);


    /**
     * Store a named property as JSON
     */
    public void property(String name, Map<String, Object> value);

    /**
     * Store a named property with one of the formats, during runtime in rules engine, platform will transform the data as
     * JSON properties are returned as Map<String,Object>
     * HEX & BASE64 properties a hex decoded and returned as byte[]
     * @param format - [JSON | HEX | BASE64]
     */
    public void property(String format, String name, String value);

    /**
     * Store a boolean value in the lookup table
     */
    public LookupContext put(String name, boolean value);

    /**
     * Store a byte value in the lookup table
     */
    public LookupContext put(String name, byte value);

    /**
     * Store a short value in the lookup table
     */
    public LookupContext put(String name, short value);

    /**
     * Store a integer value in the lookup table
     */
    public LookupContext put(String name, int value);

    /**
     * Store a float value in the lookup table
     */
    public LookupContext put(String name, float value);

    /**
     * Store a double value in the lookup table
     */
    public LookupContext put(String name, double value);

    /**
     * Store a long value in the lookup table
     */
    public LookupContext put(String name, long value);

    /**
     * Store a String value in the lookup table
     */
    public LookupContext put(String name, String value);

    /**
     * Store a UUID value in the lookup table
     */
    public LookupContext put(String name, UUID value);

    /**
     * Store a byte[] value in the lookup table
     */
    public LookupContext put(String name, byte[] value);

    /**
     * Store a Map<String,Object> value in the lookup table
     */
    public LookupContext put(String name, Map<String, Object> value);

    /**
     * Retrieve a stored lookup value in its original format
     */
    public Object get(String name);
    
    /**
     * Retreive a stored lookup value in its original format, if not found returns the passed def value
     */
    public Object get(String name, Object def);

๐Ÿ“˜

Entity Contexts those has this Lookup API