public interface HapiInfo
Modifier and Type | Method and Description |
---|---|
static HapiInfo |
fromCommentedStream(java.io.InputStream in,
int[] overread1)
Reads a HapiInfo object from an input stream containing a JSON
object with "#" signs at the start of lines,
as per the HAPI data response when it includes a header.
|
static HapiInfo |
fromJson(org.json.JSONObject json)
Reads HapiInfo from a HAPI Info response JSON object.
|
java.lang.String |
getCadence()
Returns the approximate cadence of records for this dataset.
|
java.lang.String |
getFormat()
Returns the data format.
|
HapiVersion |
getHapiVersion()
Returns the HAPI version.
|
java.lang.String |
getMaxRequestDuration()
Returns the maximum allowed duration for a request.
|
java.lang.String |
getMetadata(java.lang.String key)
Returns any other string-typed metadata item provided by the
info object.
|
HapiParam[] |
getParameters()
Returns the parameters (table columns) associated with the dataset.
|
java.lang.String |
getResourceUrl()
Returns the resource URL with additional information about the dataset.
|
java.lang.String |
getSampleStartDate()
Returns the sample start date if available.
|
java.lang.String |
getSampleStopDate()
Returns the sample stop date if available.
|
java.lang.String |
getStartDate()
Returns the start date for this dataset.
|
java.lang.String |
getStopDate()
Returns the end date for this dataset.
|
static java.lang.String |
readCommentedText(java.io.InputStream in,
int[] overread1)
Reads all the commented lines at the start of a stream,
storing the first byte of the uncommented part in a supplied buffer.
|
HapiVersion getHapiVersion()
HapiParam[] getParameters()
java.lang.String getStartDate()
java.lang.String getStopDate()
java.lang.String getFormat()
java.lang.String getResourceUrl()
java.lang.String getCadence()
java.lang.String getMaxRequestDuration()
java.lang.String getSampleStartDate()
java.lang.String getSampleStopDate()
java.lang.String getMetadata(java.lang.String key)
key
- name of entry in Info structure JSON objectstatic HapiInfo fromJson(org.json.JSONObject json)
json
- JSON objectstatic HapiInfo fromCommentedStream(java.io.InputStream in, int[] overread1) throws java.io.IOException
overread1
buffer
if present. If the end of the file is encounted before any
non-comment content, -1 is written to that buffer.in
- stream containing commented JSONoverread1
- buffer for receiving the first non-comment byte,
may be nulljava.io.IOException
static java.lang.String readCommentedText(java.io.InputStream in, int[] overread1) throws java.io.IOException
This method should be private, but Java 8, unlike Java 9+, does not permit private static methods on interfaces.
in
- stream containing commented JSONoverread1
- buffer for receiving the first non-comment byte,
may be nulljava.io.IOException