Package de.pisa.psa.rst.obj
Class PsaRstApiObjLis<T>
- java.lang.Object
-
- de.pisa.psa.rst.obj.PsaRstApiObjLis<T>
-
- Type Parameters:
T
- type of the results
public class PsaRstApiObjLis<T> extends java.lang.Object
REST API: result list for multiple objects- Since:
- 04.07.2023
- Author:
- weiland
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CONTINUATION_KEY
name of the continuation parameter
-
Constructor Summary
Constructors Constructor Description PsaRstApiObjLis()
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addResult(T result)
add a resultstatic <T> PsaRstApiObjLis<T>
fromJson(java.lang.String json, java.lang.Class<T> type)
construct the object from a JSONjava.lang.String
getContinuation()
get the continuation keyjava.util.List<T>
getResults()
get resultsvoid
setContinuation(java.lang.String continuation)
set the continuation keyint
size()
get the number of resultsjava.lang.String
toString()
-
-
-
Field Detail
-
CONTINUATION_KEY
public static final java.lang.String CONTINUATION_KEY
name of the continuation parameter- See Also:
- Constant Field Values
-
-
Method Detail
-
getContinuation
public java.lang.String getContinuation()
get the continuation key- Returns:
- key
-
setContinuation
public void setContinuation(java.lang.String continuation)
set the continuation key- Parameters:
continuation
- key
-
getResults
public java.util.List<T> getResults()
get results- Returns:
- list of results
-
size
public int size()
get the number of results- Returns:
- count
-
addResult
public void addResult(T result)
add a result- Parameters:
result
- result to add
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
fromJson
public static <T> PsaRstApiObjLis<T> fromJson(java.lang.String json, java.lang.Class<T> type) throws com.fasterxml.jackson.core.JsonProcessingException
construct the object from a JSON- Type Parameters:
T
- type of the result elements- Parameters:
json
- JSONtype
- type of the result elements- Returns:
- list
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
-