Class Ec2MetadataResponse
java.lang.Object
software.amazon.awssdk.imds.Ec2MetadataResponse
This class is used for response handling and parsing the metadata fetched by the get call in the
Ec2MetadataClient
interface. It provides convenience methods to the users to parse the metadata as a String and List. Also provides
ways to parse the metadata as Document type if it is in the json format.-
Method Summary
Modifier and TypeMethodDescriptionParses the response String into aDocument
type.asList()
Splits the Metadata response body on new line character and returns it as a list.asString()
static Ec2MetadataResponse
Create aEc2MetadataResponse
with the given body as its content.boolean
int
hashCode()
toString()
-
Method Details
-
create
Create aEc2MetadataResponse
with the given body as its content.- Parameters:
body
- the content of the response- Returns:
- a
Ec2MetadataResponse
with the given body as its content.
-
asString
- Returns:
- String Representation of the Metadata Response Body.
-
asList
-
asDocument
Parses the response String into aDocument
type. This method can be used for parsing the metadata in a String Json Format.- Returns:
- Document Representation, as json, of the Metadata Response Body.
- Throws:
UncheckedIOException
- (wrapping aJsonParseException
if the Response body is not of JSON format.
-
equals
-
hashCode
-
toString
-