case class DataverseResponse[D] extends Product with Serializable
Encapsulates a response message from Dataverse. This is often, but not always, a JSON document. This class gives access to
the response at the following levels as far as applicable (from lower to higher levels of abstraction): httpResponse
, string
,
json
, data
.
For example if the response contains metadata about a dataset, you would use the data method to retrieve a model object that
provides easy access to that structure. If JSON is returned but it is not modelled by a case class in nl.knaw.dans.lib.dataverse.model,
then you could use the json
method to get the json4s AST and query that to get to the information you need. If the body contains
UTF-8 encoded plan text, use string
. Finally, if the body contains binary data, use httpResponse
.
- D
the model object type that can be extracted (if none is available, this is set to
Any
).
- Alphabetic
- By Inheritance
- DataverseResponse
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
data: Try[D]
The corresponding model object extracted from the body.
The corresponding model object extracted from the body.
- See also
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val httpResponse: HttpResponse[Array[Byte]]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
json: Try[JValue]
The body of the response, decoded as a
org.json4s.JValue
. - def message: Try[String]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
string: Try[String]
The body of the response, decoded as UTF-8 string.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()