public final class Ec2MetadataResponse extends Object
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.| Modifier and Type | Method and Description |
|---|---|
Document |
asDocument()
Parses the response String into a
Document type. |
List<String> |
asList()
Splits the Metadata response body on new line character and returns it as a list.
|
String |
asString() |
static Ec2MetadataResponse |
create(String body)
Create a
Ec2MetadataResponse with the given body as its content. |
boolean |
equals(Object o) |
int |
hashCode() |
String |
toString() |
public static Ec2MetadataResponse create(String body)
Ec2MetadataResponse with the given body as its content.body - the content of the responseEc2MetadataResponse with the given body as its content.public String asString()
public List<String> asList()
public Document asDocument()
Document type. This method can be used for
parsing the metadata in a String Json Format.UncheckedIOException - (wrapping a JsonParseException if the Response body is not of JSON format.Copyright © 2023. All rights reserved.