Class Ec2MetadataResponse


  • public final class Ec2MetadataResponse
    extends Object
    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 Detail

      • asString

        public String asString()
        Returns:
        String Representation of the Metadata Response Body.
      • asList

        public List<String> asList()
        Splits the Metadata response body on new line character and returns it as a list.
        Returns:
        The Metadata response split on each line.
      • asDocument

        public Document asDocument()
        Parses the response String into a Document 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 a JsonParseException if the Response body is not of JSON format.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object