Class HeaderBeanMeta<T>
java.lang.Object
org.apache.juneau.http.classic.header.HeaderBeanMeta<T>
- Type Parameters:
T- The header bean type.
Holds metadata about header beans (POJOs that get serialized as HTTP headers).
Header beans are typically annotated with @Header although it's not an
absolute requirement.
Header beans must have one of the following public constructors:
public X(StringheaderValue )public X(ObjectheaderValue )public X(StringheaderName , StringheaderValue )public X(StringheaderName , ObjectheaderValue )
Example
See Also:
-
Method Summary
Modifier and TypeMethodDescriptionConstructs a header bean with the specified name or value.Constructs a header bean with the specified name or value.booleanReturns schema information about this header.inthashCode()static <T> HeaderBeanMeta<T>Finds the header bean meta for the specified type.
-
Method Details
-
of
Finds the header bean meta for the specified type.- Type Parameters:
T- The header bean type.- Parameters:
type- The header bean type. Must not benull or aNullPointerExceptionis thrown.- Returns:
- The metadata. Never
null .
-
construct
Constructs a header bean with the specified name or value.Can only be used on beans where the header name is known.
- Parameters:
value- The header value.
Can benull , in which case it is passed as-is (or stringified tonull ) to the bean's constructor.- Returns:
- A newly constructed bean.
- Throws:
UnsupportedOperationException- If bean could not be constructed (e.g. couldn't find a constructor).
-
construct
Constructs a header bean with the specified name or value.- Parameters:
name- The header name.
Ifnull , uses the value pulled from the@Header(name)or@Header(value)annotations.value- The header value.
Can benull , in which case it is passed as-is (or stringified tonull ) to the bean's constructor.- Returns:
- A newly constructed bean.
- Throws:
UnsupportedOperationException- If bean could not be constructed (e.g. couldn't find a constructor).
-
equals
-
hashCode
-
getSchema
Returns schema information about this header.This is information pulled from
@Headerannotation on the class.- Returns:
- The schema information.
-