/** * 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(Body a) { if (a == null) return true; return allEmpty(a.description(), a.example(), a.examples(), a.api(), a.value()) && allFalse(a.required()) && empty(a.schema()); }
@Test public void testAllMinusOne() { assertTrue(allMinusOne()); assertTrue(allMinusOne(-1)); assertTrue(allMinusOne(-1,-1)); assertFalse(allMinusOne(-1,0)); assertFalse(allMinusOne(0)); }
/** * 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(Response a) { if (a == null) return true; return allEmpty(a.description(), a.example(), a.examples(), a.api()) && a.headers().length == 0 && empty(a.schema()) ; }
/** * 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(org.apache.juneau.jsonschema.annotation.Items a) { if (a == null) return true; return allEmpty(a.value(), a._default(), a._enum()) && allEmpty(a.type(), a.format(), a.collectionFormat(), a.pattern(), 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()); }
/** * 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(org.apache.juneau.jsonschema.annotation.SubItems a) { if (a == null) return true; return allEmpty(a.value(), a._default(), a._enum(), a.items()) && allEmpty(a.type(), a.format(), a.collectionFormat(), a.pattern(), a.$ref(), a.maximum(), a.minimum(), a.multipleOf()) && allFalse(a.exclusiveMaximum(), a.exclusiveMinimum(), a.uniqueItems()) && allMinusOne(a.maxLength(), a.minLength(), a.maxItems(), a.minItems()); }
HttpPartSchemaBuilder items(Items value) { if (! AnnotationUtils.empty(value)) items = HttpPartSchema.create().apply(value); 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(License a) { if (a == null) return true; return allEmpty(a.value()) && allEmpty(a.name(), a.url()); }
/** * 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(org.apache.juneau.jsonschema.annotation.Items a) { if (a == null) return true; return allEmpty(a.value(), a._default(), a._enum()) && allEmpty(a.type(), a.format(), a.collectionFormat(), a.pattern(), 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()); }
/** * 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(org.apache.juneau.jsonschema.annotation.SubItems a) { if (a == null) return true; return allEmpty(a.value(), a._default(), a._enum(), a.items()) && allEmpty(a.type(), a.format(), a.collectionFormat(), a.pattern(), a.$ref(), a.maximum(), a.minimum(), a.multipleOf()) && allFalse(a.exclusiveMaximum(), a.exclusiveMinimum(), a.uniqueItems()) && allMinusOne(a.maxLength(), a.minLength(), a.maxItems(), a.minItems()); }
HttpPartSchemaBuilder items(SubItems value) { if (! AnnotationUtils.empty(value)) items = HttpPartSchema.create().apply(value); 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(Response a) { if (a == null) return true; return allEmpty(a.description(), a.example(), a.examples(), a.api()) && a.headers().length == 0 && empty(a.schema()) ; }
/** * 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(org.apache.juneau.jsonschema.annotation.ExternalDocs a) { if (a == null) return true; return allEmpty(a.value(), a.description()) && allEmpty(a.url()); }
/** * 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(org.apache.juneau.jsonschema.annotation.Items a) { if (a == null) return true; return allEmpty(a.value(), a._default(), a._enum()) && allEmpty(a.type(), a.format(), a.collectionFormat(), a.pattern(), 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()); }
/** * 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(Body a) { if (a == null) return true; return allEmpty(a.description(), a.example(), a.examples(), a.api(), a.value()) && allFalse(a.required()) && empty(a.schema()); }
/** * 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(org.apache.juneau.jsonschema.annotation.SubItems a) { if (a == null) return true; return allEmpty(a.value(), a._default(), a._enum(), a.items()) && allEmpty(a.type(), a.format(), a.collectionFormat(), a.pattern(), a.$ref(), a.maximum(), a.minimum(), a.multipleOf()) && allFalse(a.exclusiveMaximum(), a.exclusiveMinimum(), a.uniqueItems()) && allMinusOne(a.maxLength(), a.minLength(), a.maxItems(), a.minItems()); }
HttpPartSchemaBuilder items(Items value) { if (! AnnotationUtils.empty(value)) items = HttpPartSchema.create().apply(value); 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(Response a) { if (a == null) return true; return allEmpty(a.description(), a.example(), a.examples(), a.api()) && a.headers().length == 0 && empty(a.schema()) ; }
/** * 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(org.apache.juneau.jsonschema.annotation.ExternalDocs a) { if (a == null) return true; return allEmpty(a.value(), a.description()) && allEmpty(a.url()); }
@Test public void testAllMinusOneLongs() { assertTrue(allMinusOne(-1l)); assertTrue(allMinusOne(-1l,-1l)); assertFalse(allMinusOne(-1l,0l)); assertFalse(allMinusOne(0l)); } }