Updated on 2022-02-21 GMT+08:00

CacheUtils

Path

com.huawei.livedata.lambdaservice.util.CacheUtils

Description

This class is used to save and obtain cache information.

Method List

Returned Type

Method and Description

static boolean

putCache(String key, String value)

Save cache information.

static boolean

putCache(String key, String value, int time)

Save the cache information with the timeout interval.

static String

getCache(String key)

Obtain cache information.

static long

removeCache(String key)

Remove cache information.

static String

get(String key)

Obtain dictionary cache information.

Method Details

  • public static boolean putCache(String key, String value)

    Save cache information.

    Input Parameter

    • key indicates the key value of cache information.
    • value indicates the cache information.

    Returns

    Corresponding boolean value.

  • public static boolean putCache(String key, String value, int time)

    Save the cache information with the timeout interval.

    Input Parameter

    • key indicates the key value of cache information.
    • value indicates the cache information.
    • time indicates the timeout interval.

    Returns

    Corresponding boolean value.

  • public static String getCache(String key)

    Obtain cache information.

    Input Parameter

    key indicates the key value of cache information.

    Returns

    Cache information corresponding to the key value.

  • public static long removeCache(String key)

    Remove cache information.

    Input Parameter

    key indicates the key value of cache information to be removed.

    Returns

    Execution result.

  • public static String get(String key)

    Obtain dictionary cache information.

    Input Parameter

    key indicates the key value of dictionary cache information.

    Returns

    Dictionary cache information corresponding to the key value.