/** * 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(Header 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.pattern(), a.collectionFormat(), a.maximum(), a.minimum(), a.multipleOf()) && allFalse(a.exclusiveMaximum(), a.exclusiveMinimum(), a.required(), a.uniqueItems()) && allMinusOne(a.maxLength(), a.minLength(), a.maxItems(), a.minItems()) && empty(a.items()); }
/** * 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(Header 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.pattern(), a.collectionFormat(), a.maximum(), a.minimum(), a.multipleOf()) && allFalse(a.exclusiveMaximum(), a.exclusiveMinimum(), a.required(), a.uniqueItems()) && allMinusOne(a.maxLength(), a.minLength(), a.maxItems(), a.minItems()) && empty(a.items()); }
/** * 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(Header 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.pattern(), a.collectionFormat(), a.maximum(), a.minimum(), a.multipleOf()) && allFalse(a.exclusiveMaximum(), a.exclusiveMinimum(), a.required(), a.uniqueItems()) && allMinusOne(a.maxLength(), a.minLength(), a.maxItems(), a.minItems()) && empty(a.items()); }
private ObjectMap merge(ObjectMap om, Header 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()) .appendSkipEmpty("minimum", a.minimum()) .appendSkipMinusOne("minItems", a.minItems()) .appendSkipMinusOne("minLength", a.minLength()) .appendSkipEmpty("multipleOf", a.multipleOf()) .appendSkipEmpty("pattern", a.pattern()) .appendSkipFalse("required", a.required()) .appendSkipEmpty("type", a.type()) .appendSkipFalse("uniqueItems", a.uniqueItems()) ; }
private ObjectMap merge(ObjectMap om, Header 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()) .appendSkipEmpty("minimum", a.minimum()) .appendSkipMinusOne("minItems", a.minItems()) .appendSkipMinusOne("minLength", a.minLength()) .appendSkipEmpty("multipleOf", a.multipleOf()) .appendSkipEmpty("pattern", a.pattern()) .appendSkipFalse("required", a.required()) .appendSkipEmpty("type", a.type()) .appendSkipFalse("uniqueItems", a.uniqueItems()) ; }
private ObjectMap merge(ObjectMap om, Header 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()) .appendSkipEmpty("minimum", a.minimum()) .appendSkipMinusOne("minItems", a.minItems()) .appendSkipMinusOne("minLength", a.minLength()) .appendSkipEmpty("multipleOf", a.multipleOf()) .appendSkipEmpty("pattern", a.pattern()) .appendSkipFalse("required", a.required()) .appendSkipEmpty("type", a.type()) .appendSkipFalse("uniqueItems", a.uniqueItems()) ; }