/** * Get the HTTP response headers. * * @return * The HTTP response headers. * <br>An unmodifiable map. * <br>Never <jk>null</jk>. */ @ResponseHeader("*") public Map<String,Object> getHeaders() { return headers; }
/** * Returns <jk>true</jk> if the specified annotation contains all default values. * * @param a The annotation to check. * @return <jk>true</jk> if the specified annotation contains all default values. */ public static boolean empty(ResponseHeader a) { if (a == null) return true; return allEmpty(a.description(), a._default(), a._enum(), a.example(), a.api()) && allEmpty(a.name(), a.value(), a.type(), a.format(), a.collectionFormat(), a.$ref(), a.maximum(), a.minimum(), a.multipleOf()) && allFalse(a.exclusiveMaximum(), a.exclusiveMinimum(), a.uniqueItems()) && allMinusOne(a.maxLength(), a.minLength(), a.maxItems(), a.minItems()) && empty(a.items()); }
private static Set<Integer> getCodes2(List<ResponseHeader> la, Integer def) { Set<Integer> codes = new TreeSet<>(); for (ResponseHeader a : la) { for (int i : a.code()) codes.add(i); } if (codes.isEmpty() && def != null) codes.add(def); return codes; }
HttpPartSchemaBuilder apply(ResponseHeader a) { name(a.value()); name(a.name()); codes(a.code()); type(a.type()); format(a.format()); items(a.items()); collectionFormat(a.collectionFormat()); _default(a._default().length == 0 ? null : joinnl(a._default())); maximum(HttpPartSchema.toNumber(a.maximum())); exclusiveMaximum(a.exclusiveMaximum()); minimum(HttpPartSchema.toNumber(a.minimum())); exclusiveMinimum(a.exclusiveMinimum()); maxLength(a.maxLength()); minLength(a.minLength()); pattern(a.pattern()); maxItems(a.maxItems()); minItems(a.minItems()); uniqueItems(a.uniqueItems()); _enum(HttpPartSchema.toSet(a._enum())); multipleOf(HttpPartSchema.toNumber(a.multipleOf())); allowEmptyValue(false); serializer(a.serializer()); return this; }
HttpPartSchemaBuilder apply(ResponseHeader a) { name(a.value()); name(a.name()); codes(a.code()); type(a.type()); format(a.format()); items(a.items()); collectionFormat(a.collectionFormat()); _default(a._default().length == 0 ? null : joinnl(a._default())); maximum(HttpPartSchema.toNumber(a.maximum())); exclusiveMaximum(a.exclusiveMaximum()); minimum(HttpPartSchema.toNumber(a.minimum())); exclusiveMinimum(a.exclusiveMinimum()); maxLength(a.maxLength()); minLength(a.minLength()); pattern(a.pattern()); maxItems(a.maxItems()); minItems(a.minItems()); uniqueItems(a.uniqueItems()); _enum(HttpPartSchema.toSet(a._enum())); multipleOf(HttpPartSchema.toNumber(a.multipleOf())); allowEmptyValue(false); serializer(a.serializer()); return this; }
/** * Returns <jk>true</jk> if the specified annotation contains all default values. * * @param a The annotation to check. * @return <jk>true</jk> if the specified annotation contains all default values. */ public static boolean empty(ResponseHeader a) { if (a == null) return true; return allEmpty(a.description(), a._default(), a._enum(), a.example(), a.api()) && allEmpty(a.name(), a.value(), a.type(), a.format(), a.collectionFormat(), a.$ref(), a.maximum(), a.minimum(), a.multipleOf()) && allFalse(a.exclusiveMaximum(), a.exclusiveMinimum(), a.uniqueItems()) && allMinusOne(a.maxLength(), a.minLength(), a.maxItems(), a.minItems()) && empty(a.items()); }
HttpPartSchemaBuilder apply(ResponseHeader a) { name(a.value()); name(a.name()); codes(a.code()); type(a.type()); format(a.format()); items(a.items()); collectionFormat(a.collectionFormat()); _default(a._default().length == 0 ? null : joinnl(a._default())); maximum(HttpPartSchema.toNumber(a.maximum())); exclusiveMaximum(a.exclusiveMaximum()); minimum(HttpPartSchema.toNumber(a.minimum())); exclusiveMinimum(a.exclusiveMinimum()); maxLength(a.maxLength()); minLength(a.minLength()); pattern(a.pattern()); maxItems(a.maxItems()); minItems(a.minItems()); uniqueItems(a.uniqueItems()); _enum(HttpPartSchema.toSet(a._enum())); multipleOf(HttpPartSchema.toNumber(a.multipleOf())); allowEmptyValue(false); serializer(a.serializer()); return this; }
@ResponseHeader("Content-Type") @Override /* Writeable */ public MediaType getMediaType() { return mediaType; }
private static Set<Integer> getCodes2(List<ResponseHeader> la, Integer def) { Set<Integer> codes = new TreeSet<>(); for (ResponseHeader a : la) { for (int i : a.code()) codes.add(i); } if (codes.isEmpty() && def != null) codes.add(def); return codes; }
/** * Returns <jk>true</jk> if the specified annotation contains all default values. * * @param a The annotation to check. * @return <jk>true</jk> if the specified annotation contains all default values. */ public static boolean empty(ResponseHeader a) { if (a == null) return true; return allEmpty(a.description(), a._default(), a._enum(), a.example(), a.api()) && allEmpty(a.name(), a.value(), a.type(), a.format(), a.collectionFormat(), a.$ref(), a.maximum(), a.minimum(), a.multipleOf()) && allFalse(a.exclusiveMaximum(), a.exclusiveMinimum(), a.uniqueItems()) && allMinusOne(a.maxLength(), a.minLength(), a.maxItems(), a.minItems()) && empty(a.items()); }
@ResponseHeader("Content-Type") @Override /* Streamable */ public MediaType getMediaType() { return mediaType; }
private static Set<Integer> getCodes2(List<ResponseHeader> la, Integer def) { Set<Integer> codes = new TreeSet<>(); for (ResponseHeader a : la) { for (int i : a.code()) codes.add(i); } if (codes.isEmpty() && def != null) codes.add(def); return codes; }
private ObjectMap merge(ObjectMap om, ResponseHeader a) throws ParseException { if (empty(a)) return om; om = newMap(om); if (a.api().length > 0) om.putAll(parseMap(a.api())); return om .appendSkipEmpty("collectionFormat", a.collectionFormat()) .appendSkipEmpty("default", joinnl(a._default())) .appendSkipEmpty("description", resolve(a.description())) .appendSkipEmpty("enum", toSet(a._enum())) .appendSkipEmpty("x-example", resolve(a.example())) .appendSkipFalse("exclusiveMaximum", a.exclusiveMaximum()) .appendSkipFalse("exclusiveMinimum", a.exclusiveMinimum()) .appendSkipEmpty("format", a.format()) .appendSkipEmpty("items", merge(om.getObjectMap("items"), a.items())) .appendSkipEmpty("maximum", a.maximum()) .appendSkipMinusOne("maxItems", a.maxItems()) .appendSkipMinusOne("maxLength", a.maxLength()) .appendSkipMinusOne("maxItems", a.maxItems()) .appendSkipEmpty("minimum", a.minimum()) .appendSkipMinusOne("minItems", a.minItems()) .appendSkipMinusOne("minLength", a.minLength()) .appendSkipEmpty("multipleOf", a.multipleOf()) .appendSkipEmpty("pattern", a.pattern()) .appendSkipEmpty("type", a.type()) .appendSkipFalse("uniqueItems", a.uniqueItems()) .appendSkipEmpty("$ref", a.$ref()) ; }
/** * @return <code>Location</code> header value. */ @ResponseHeader(name="Location", description="Temporary location of resource.") public URI getLocation() { return location; } }
private ObjectMap merge(ObjectMap om, ResponseHeader a) throws ParseException { if (empty(a)) return om; om = newMap(om); if (a.api().length > 0) om.putAll(parseMap(a.api())); return om .appendSkipEmpty("collectionFormat", a.collectionFormat()) .appendSkipEmpty("default", joinnl(a._default())) .appendSkipEmpty("description", resolve(a.description())) .appendSkipEmpty("enum", toSet(a._enum())) .appendSkipEmpty("x-example", resolve(a.example())) .appendSkipFalse("exclusiveMaximum", a.exclusiveMaximum()) .appendSkipFalse("exclusiveMinimum", a.exclusiveMinimum()) .appendSkipEmpty("format", a.format()) .appendSkipEmpty("items", merge(om.getObjectMap("items"), a.items())) .appendSkipEmpty("maximum", a.maximum()) .appendSkipMinusOne("maxItems", a.maxItems()) .appendSkipMinusOne("maxLength", a.maxLength()) .appendSkipMinusOne("maxItems", a.maxItems()) .appendSkipEmpty("minimum", a.minimum()) .appendSkipMinusOne("minItems", a.minItems()) .appendSkipMinusOne("minLength", a.minLength()) .appendSkipEmpty("multipleOf", a.multipleOf()) .appendSkipEmpty("pattern", a.pattern()) .appendSkipEmpty("type", a.type()) .appendSkipFalse("uniqueItems", a.uniqueItems()) .appendSkipEmpty("$ref", a.$ref()) ; }
/** * @return <code>Location</code> header value. */ @ResponseHeader(name="Location", description="New location of resource.") public URI getLocation() { return location; } }
private ObjectMap merge(ObjectMap om, ResponseHeader a) throws ParseException { if (empty(a)) return om; om = newMap(om); if (a.api().length > 0) om.putAll(parseMap(a.api())); return om .appendSkipEmpty("collectionFormat", a.collectionFormat()) .appendSkipEmpty("default", joinnl(a._default())) .appendSkipEmpty("description", resolve(a.description())) .appendSkipEmpty("enum", toSet(a._enum())) .appendSkipEmpty("x-example", resolve(a.example())) .appendSkipFalse("exclusiveMaximum", a.exclusiveMaximum()) .appendSkipFalse("exclusiveMinimum", a.exclusiveMinimum()) .appendSkipEmpty("format", a.format()) .appendSkipEmpty("items", merge(om.getObjectMap("items"), a.items())) .appendSkipEmpty("maximum", a.maximum()) .appendSkipMinusOne("maxItems", a.maxItems()) .appendSkipMinusOne("maxLength", a.maxLength()) .appendSkipMinusOne("maxItems", a.maxItems()) .appendSkipEmpty("minimum", a.minimum()) .appendSkipMinusOne("minItems", a.minItems()) .appendSkipMinusOne("minLength", a.minLength()) .appendSkipEmpty("multipleOf", a.multipleOf()) .appendSkipEmpty("pattern", a.pattern()) .appendSkipEmpty("type", a.type()) .appendSkipFalse("uniqueItems", a.uniqueItems()) .appendSkipEmpty("$ref", a.$ref()) ; }
/** * Get the HTTP response headers. * * @return * The HTTP response headers. * <br>An unmodifiable map. * <br>Never <jk>null</jk>. */ @ResponseHeader("*") public Map<String,Object> getHeaders() { return headers; }
/** * @return <code>Location</code> header value. */ @ResponseHeader(name="Location", description="New location of resource.") public URI getLocation() { return location; } }
/** * Get the HTTP response headers. * * @return * The HTTP response headers. * <br>An unmodifiable map. * <br>Never <jk>null</jk>. */ @ResponseHeader("*") public Map<String,Object> getHeaders() { return headers; }