ArraySchemaLoader { ArraySchema.Builder load() { ArraySchema.Builder builder = ArraySchema.builder(); ls.schemaJson().maybe("minItems").map(JsonValue::requireInteger).ifPresent(builder::minItems); ls.schemaJson().maybe("maxItems").map(JsonValue::requireInteger).ifPresent(builder::maxItems); ls.schemaJson().maybe("uniqueItems").map(JsonValue::requireBoolean).ifPresent(builder::uniqueItems); ls.schemaJson().maybe("additionalItems").ifPresent(maybe -> { maybe.canBe(Boolean.class, builder::additionalItems) .or(JsonObject.class, obj -> builder.schemaOfAdditionalItems(defaultLoader.loadChild(obj).build())) .requireAny(); }); ls.schemaJson().maybe("items").ifPresent(items -> { items.canBeSchema(itemSchema -> builder.allItemSchema(defaultLoader.loadChild(itemSchema).build())) .or(JsonArray.class, arr -> buildTupleSchema(builder, arr)) .requireAny(); }); if (config.specVersion != DRAFT_4) { ls.schemaJson().maybe("contains").ifPresent(containedRawSchema -> addContainedSchema(builder, containedRawSchema)); } return builder; } @Deprecated  ArraySchemaLoader(LoadingState ls, SchemaLoader defaultLoader);   ArraySchemaLoader(LoadingState ls,
            LoaderConfig config,
            SchemaLoader defaultLoader);   }
@Test public void additionalItemSchema() { assertTrue(SchemaLoader.load(get("additionalItemSchema")) instanceof ArraySchema); }
@Test public void arrayByAdditionalItems() { ArraySchema actual = (ArraySchema) SchemaLoader.load(get("arrayByAdditionalItems")); Assert.assertFalse(actual.requiresArray()); }
@Test public void arrayByItems() { ArraySchema actual = (ArraySchema) SchemaLoader.load(get("arrayByItems")); assertNotNull(actual); }
@Test public void arraySchema() { ArraySchema actual = (ArraySchema) SchemaLoader.load(get("arraySchema")); assertNotNull(actual); assertEquals(2, actual.getMinItems().intValue()); assertEquals(3, actual.getMaxItems().intValue()); assertTrue(actual.needsUniqueItems()); assertEquals(NullSchema.INSTANCE, actual.getAllItemSchema()); }
@Test(expected = SchemaException.class) public void invalidAdditionalItems() { SchemaLoader.load(get("invalidAdditionalItems")); }
@Test(expected = SchemaException.class) public void invalidArrayItemSchema() { SchemaLoader.load(get("invalidArrayItemSchema")); }
@Test(expected = SchemaException.class) public void invalidItemsArraySchema() { SchemaLoader.load(get("invalidItemsArraySchema")); }
@Test public void v4LoaderDoesNotSupportContains() { ArraySchema result = (ArraySchema) SchemaLoader.load(get("arrayWithContains")); assertNull(result.getContainedItemSchema()); }