Package com.vivokey.chipscanlib
Class KVPairAPI
- java.lang.Object
-
- com.vivokey.chipscanlib.KVPairAPI
-
public class KVPairAPI extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected VivoAuthResult
authResult
protected String
chall
protected cz.msebera.android.httpclient.impl.client.HttpClientBuilder
clientBuilder
protected cz.msebera.android.httpclient.client.HttpClient
httpClient
protected cz.msebera.android.httpclient.client.methods.HttpPost
postGetKv
protected cz.msebera.android.httpclient.client.methods.HttpPost
postSetKv
-
Constructor Summary
Constructors Constructor Description KVPairAPI(VivoAuthResult authres)
Public constructor for a KVPairAPI object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getKV(String[] keys)
Calls the API to get key-value pairs and returns the list.boolean
setKV(Map<String,String> keyvals)
Calls the API to set key-value pairs and returns if successful.
-
-
-
Field Detail
-
chall
protected String chall
-
postSetKv
protected final cz.msebera.android.httpclient.client.methods.HttpPost postSetKv
-
postGetKv
protected final cz.msebera.android.httpclient.client.methods.HttpPost postGetKv
-
httpClient
protected cz.msebera.android.httpclient.client.HttpClient httpClient
-
clientBuilder
protected final cz.msebera.android.httpclient.impl.client.HttpClientBuilder clientBuilder
-
authResult
protected VivoAuthResult authResult
-
-
Constructor Detail
-
KVPairAPI
public KVPairAPI(VivoAuthResult authres)
Public constructor for a KVPairAPI object.- Parameters:
authres
- the VivoAuthResult object to process key-value pairs for.
-
-
Method Detail
-
setKV
public boolean setKV(Map<String,String> keyvals)
Calls the API to set key-value pairs and returns if successful.- Parameters:
keyvals
- a Mapcontaining pairs to set. - Returns:
- Success or failure.
-
getKV
public boolean getKV(String[] keys)
Calls the API to get key-value pairs and returns the list.- Parameters:
keys
- a String[] of keys to get.auth
- the VivoAuthResult containing the authentication these are to be set against.- Returns:
- a Map
of keys and values. Null if failed.
-
-