summary:"Creates instance of <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref> with given byte array."
modifiers:
- "static"
parameters:
- description:"used to create another instance of <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref>."
desc:"Creates instance of <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref> with given byte array."
returns:
description:"AmqpMessageBody Newly created instance."
summary:"Creates an instance of <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref> with the given <xref uid=\"java.util.List\" data-throw-if-not-resolved=\"false\" data-raw-source=\"sequence\"></xref>."
modifiers:
- "static"
parameters:
- description:"used to create an instance of <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref>. A sequence can be <xref uid=\"java.util.List\" data-throw-if-not-resolved=\"false\" data-raw-source=\"List\"></xref> of\n <xref uid=\"java.lang.Object\" data-throw-if-not-resolved=\"false\" data-raw-source=\"objects\"></xref>. The <xref uid=\"java.lang.Object\" data-throw-if-not-resolved=\"false\" data-raw-source=\"object\"></xref> can be any of the AMQP supported primitive data type."
desc:"Creates an instance of <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref> with the given <xref uid=\"java.util.List\" data-throw-if-not-resolved=\"false\" data-raw-source=\"sequence\"></xref>. It supports only one `sequence` at present."
returns:
description:"newly created instance of <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref>."
summary:"Creates an instance of <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref> with the given <xref uid=\"java.lang.Object\" data-throw-if-not-resolved=\"false\" data-raw-source=\"value\"></xref>."
modifiers:
- "static"
parameters:
- description:"used to create an instance of <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref>."
desc:"Creates an instance of <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref> with the given <xref uid=\"java.lang.Object\" data-throw-if-not-resolved=\"false\" data-raw-source=\"value\"></xref>. A value can be any of the AMQP supported primitive data type."
returns:
description:"newly created instance of <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref>."
summary:"Gets the <xref uid=\"com.azure.core.amqp.models.AmqpMessageBodyType\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBodyType\"></xref> of the message."
syntax:"public AmqpMessageBodyType getBodyType()"
desc:"Gets the <xref uid=\"com.azure.core.amqp.models.AmqpMessageBodyType\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBodyType\"></xref> of the message.\n\n**How to check for <xref uid=\"com.azure.core.amqp.models.AmqpMessageBodyType\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBodyType\"></xref>**\n\n```java\nObject amqpValue;\n AmqpMessageBodyType bodyType = amqpAnnotatedMessage.getBody().getBodyType();\n\n switch (bodyType) {\n case DATA:\n byte[] payload = amqpAnnotatedMessage.getBody().getFirstData();\n System.out.println(new String(payload));\n break;\n case SEQUENCE:\n List<Object> sequenceData = amqpAnnotatedMessage.getBody().getSequence();\n sequenceData.forEach(System.out::println);\n break;\n case VALUE:\n amqpValue = amqpAnnotatedMessage.getBody().getValue();\n System.out.println(amqpValue);\n break;\n default:\n throw new RuntimeException(String.format(Locale.US, \"Body type [%s] is not valid.\", bodyType));\n }\n```"
summary:"Gets an <xref uid=\"com.azure.core.util.IterableStream\" data-throw-if-not-resolved=\"false\" data-raw-source=\"IterableStream\"></xref> of byte array containing only first byte array set on this <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref>."
syntax:"public IterableStream<byte[]> getData()"
desc:"Gets an <xref uid=\"com.azure.core.util.IterableStream\" data-throw-if-not-resolved=\"false\" data-raw-source=\"IterableStream\"></xref> of byte array containing only first byte array set on this <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref>. This library only support one byte array at present, so the returned list will have only one element.\n\n**Client should test for <xref uid=\"com.azure.core.amqp.models.AmqpMessageBodyType\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBodyType\"></xref> before calling corresponding get method. Get methods not corresponding to the type of the body throws exception.**\n\n**How to check for <xref uid=\"com.azure.core.amqp.models.AmqpMessageBodyType\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBodyType\"></xref>**\n\n```java\nObject amqpValue;\n AmqpMessageBodyType bodyType = amqpAnnotatedMessage.getBody().getBodyType();\n\n switch (bodyType) {\n case DATA:\n byte[] payload = amqpAnnotatedMessage.getBody().getFirstData();\n System.out.println(new String(payload));\n break;\n case SEQUENCE:\n List<Object> sequenceData = amqpAnnotatedMessage.getBody().getSequence();\n sequenceData.forEach(System.out::println);\n break;\n case VALUE:\n amqpValue = amqpAnnotatedMessage.getBody().getValue();\n System.out.println(amqpValue);\n break;\n default:\n throw new RuntimeException(String.format(Locale.US, \"Body type [%s] is not valid.\", bodyType));\n }\n```"
returns:
description:"data set on <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref>."
summary:"Gets first byte array set on this <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref>."
syntax:"public byte[] getFirstData()"
desc:"Gets first byte array set on this <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref>. This library only support one byte array on Amqp Message at present.\n\n**Client should test for <xref uid=\"com.azure.core.amqp.models.AmqpMessageBodyType\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBodyType\"></xref> before calling corresponding get method. Get methods not corresponding to the type of the body throws exception.**\n\n**How to check for <xref uid=\"com.azure.core.amqp.models.AmqpMessageBodyType\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBodyType\"></xref>**\n\n```java\nObject amqpValue;\n AmqpMessageBodyType bodyType = amqpAnnotatedMessage.getBody().getBodyType();\n\n switch (bodyType) {\n case DATA:\n byte[] payload = amqpAnnotatedMessage.getBody().getFirstData();\n System.out.println(new String(payload));\n break;\n case SEQUENCE:\n List<Object> sequenceData = amqpAnnotatedMessage.getBody().getSequence();\n sequenceData.forEach(System.out::println);\n break;\n case VALUE:\n amqpValue = amqpAnnotatedMessage.getBody().getValue();\n System.out.println(amqpValue);\n break;\n default:\n throw new RuntimeException(String.format(Locale.US, \"Body type [%s] is not valid.\", bodyType));\n }\n```"
returns:
description:"data set on <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref>."
summary:"Gets the unmodifiable AMQP Sequence set on this <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref>."
syntax:"public List<Object> getSequence()"
desc:"Gets the unmodifiable AMQP Sequence set on this <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref>. It support only one `sequence` at present.\n\n**Client should test for <xref uid=\"com.azure.core.amqp.models.AmqpMessageBodyType\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBodyType\"></xref> before calling corresponding get method. Get methods not corresponding to the type of the body throws exception.**\n\n**How to check for <xref uid=\"com.azure.core.amqp.models.AmqpMessageBodyType\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBodyType\"></xref>**\n\n```java\nObject amqpValue;\n AmqpMessageBodyType bodyType = amqpAnnotatedMessage.getBody().getBodyType();\n\n switch (bodyType) {\n case DATA:\n byte[] payload = amqpAnnotatedMessage.getBody().getFirstData();\n System.out.println(new String(payload));\n break;\n case SEQUENCE:\n List<Object> sequenceData = amqpAnnotatedMessage.getBody().getSequence();\n sequenceData.forEach(System.out::println);\n break;\n case VALUE:\n amqpValue = amqpAnnotatedMessage.getBody().getValue();\n System.out.println(amqpValue);\n break;\n default:\n throw new RuntimeException(String.format(Locale.US, \"Body type [%s] is not valid.\", bodyType));\n }\n```"
returns:
description:"sequence of this <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref> instance."
summary:"Gets the AMQP value set on this <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref> instance."
syntax:"public Object getValue()"
desc:"Gets the AMQP value set on this <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref> instance. It can be any of the primitive AMQP data type.\n\n**Client should test for <xref uid=\"com.azure.core.amqp.models.AmqpMessageBodyType\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBodyType\"></xref> before calling corresponding get method. The 'Get' methods not corresponding to the type of the body throws exception.**\n\n**How to check for <xref uid=\"com.azure.core.amqp.models.AmqpMessageBodyType\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBodyType\"></xref>**\n\n```java\nObject amqpValue;\n AmqpMessageBodyType bodyType = amqpAnnotatedMessage.getBody().getBodyType();\n\n switch (bodyType) {\n case DATA:\n byte[] payload = amqpAnnotatedMessage.getBody().getFirstData();\n System.out.println(new String(payload));\n break;\n case SEQUENCE:\n List<Object> sequenceData = amqpAnnotatedMessage.getBody().getSequence();\n sequenceData.forEach(System.out::println);\n break;\n case VALUE:\n amqpValue = amqpAnnotatedMessage.getBody().getValue();\n System.out.println(amqpValue);\n break;\n default:\n throw new RuntimeException(String.format(Locale.US, \"Body type [%s] is not valid.\", bodyType));\n }\n```"
returns:
description:"value of this <xref uid=\"com.azure.core.amqp.models.AmqpMessageBody\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBody\"></xref> instance."
desc:"This class encapsulates the body of a message. The <xref uid=\"com.azure.core.amqp.models.AmqpMessageBodyType\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBodyType\"></xref> map to an AMQP specification message body types. Current implementation support <xref uid=\"com.azure.core.amqp.models.AmqpMessageBodyType.DATA\" data-throw-if-not-resolved=\"false\" data-raw-source=\"DATA\"></xref> AMQP data type.\n\n**Client should test for <xref uid=\"com.azure.core.amqp.models.AmqpMessageBodyType\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBodyType\"></xref> before calling corresponding get method. Get methods not corresponding to the type of the body throws exception.**\n\n**How to check for <xref uid=\"com.azure.core.amqp.models.AmqpMessageBodyType\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpMessageBodyType\"></xref>**\n\n```java\nObject amqpValue;\n AmqpMessageBodyType bodyType = amqpAnnotatedMessage.getBody().getBodyType();\n\n switch (bodyType) {\n case DATA:\n byte[] payload = amqpAnnotatedMessage.getBody().getFirstData();\n System.out.println(new String(payload));\n break;\n case SEQUENCE:\n List<Object> sequenceData = amqpAnnotatedMessage.getBody().getSequence();\n sequenceData.forEach(System.out::println);\n break;\n case VALUE:\n amqpValue = amqpAnnotatedMessage.getBody().getValue();\n System.out.println(amqpValue);\n break;\n default:\n throw new RuntimeException(String.format(Locale.US, \"Body type [%s] is not valid.\", bodyType));\n }\n```"