CombinedSchema extends Schema { public static Builder oneOf(Collection<Schema> schemas) { return builder(schemas).criterion(ONE_CRITERION); } CombinedSchema(Builder builder); static Builder allOf(Collection<Schema> schemas); static Builder anyOf(Collection<Schema> schemas); static Builder builder(); static Builder builder(Collection<Schema> subschemas); static Builder oneOf(Collection<Schema> schemas); ValidationCriterion getCriterion(); Collection<Schema> getSubschemas(); @Override boolean definesProperty(String field); @Override boolean equals(Object o); @Override int hashCode(); static final ValidationCriterion ALL_CRITERION; static final ValidationCriterion ANY_CRITERION; static final ValidationCriterion ONE_CRITERION; }
@Test public void validateOne() { TestSupport.failureOf(CombinedSchema.oneOf(SUBSCHEMAS)) .input(30) .expectedKeyword("oneOf") .expect(); }