public class HttpPart extends Object implements NameValuePair
Can be used to represent both request and response parts.
Constructor and Description |
---|
HttpPart(String name,
HttpPartType partType,
HttpPartSchema schema,
HttpPartParserSession parser,
String part)
Constructor.
|
HttpPart(String name,
HttpPartType partType,
HttpPartSchema schema,
HttpPartSerializerSession serializer,
Object part)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
asType(Class<T> c)
Returns the value of the part converted to a string.
|
String |
getName() |
String |
getValue() |
public HttpPart(String name, HttpPartType partType, HttpPartSchema schema, HttpPartSerializerSession serializer, Object part)
Used when the part is in POJO form and needs to be converted to a String.
name
- The HTTP part name (e.g. the header name).partType
- The HTTP part type.schema
- Schema information about the part.serializer
- The part serializer to use to serialize the part.part
- The part POJO being serialized.public HttpPart(String name, HttpPartType partType, HttpPartSchema schema, HttpPartParserSession parser, String part)
Used when the part is in String form and needs to be converted to a POJO.
name
- The HTTP part name (e.g. the header name).partType
- The HTTP part type.schema
- Schema information about the part.parser
- The part parser to use to parse the part.part
- The part string being parsed.public String getName()
getName
in interface NameValuePair
public String getValue()
getValue
in interface NameValuePair
public <T> T asType(Class<T> c) throws SchemaValidationException, ParseException
c
- The type to convert to.SchemaValidationException
- HTTP part failed schema validation.ParseException
- Malformed input encountered.Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.