|
| 1 | +# ItemsContains |
| 2 | +org.openapijsonschematools.client.components.schemas.ItemsContains.java |
| 3 | +public class ItemsContains |
| 4 | + |
| 5 | +A class that contains necessary nested |
| 6 | +- schema classes (which validate payloads), extends JsonSchema |
| 7 | +- classes to store validated list payloads, extends FrozenList |
| 8 | +- classes to build inputs for list payloads |
| 9 | + |
| 10 | +## Nested Class Summary |
| 11 | +| Modifier and Type | Class and Description | |
| 12 | +| ----------------- | ---------------------- | |
| 13 | +| static class | [ItemsContains.ItemsContains1](#itemscontains1)<br> schema class | |
| 14 | +| static class | [ItemsContains.ItemsContainsListBuilder](#itemscontainslistbuilder)<br> builder for List payloads | |
| 15 | +| static class | [ItemsContains.ItemsContainsList](#itemscontainslist)<br> output class for List payloads | |
| 16 | +| static class | [ItemsContains.Items](#items)<br> schema class | |
| 17 | +| static class | [ItemsContains.Contains](#contains)<br> schema class | |
| 18 | + |
| 19 | +## ItemsContains1 |
| 20 | +public static class ItemsContains1<br> |
| 21 | +extends JsonSchema |
| 22 | + |
| 23 | +A schema class that validates payloads |
| 24 | + |
| 25 | +### Code Sample |
| 26 | +``` |
| 27 | +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; |
| 28 | +import org.openapijsonschematools.client.configurations.SchemaConfiguration; |
| 29 | +import org.openapijsonschematools.client.exceptions.ValidationException; |
| 30 | +import org.openapijsonschematools.client.schemas.validation.MapUtils; |
| 31 | +import org.openapijsonschematools.client.schemas.validation.FrozenList; |
| 32 | +import org.openapijsonschematools.client.schemas.validation.FrozenMap; |
| 33 | +
|
| 34 | +import java.util.Arrays; |
| 35 | +import java.util.List; |
| 36 | +import java.util.AbstractMap; |
| 37 | +
|
| 38 | +static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); |
| 39 | +
|
| 40 | +// List validation |
| 41 | +ItemsContains.ItemsContainsList validatedPayload = |
| 42 | + ItemsContains.ItemsContains1.validate( |
| 43 | + new ItemsContains.ItemsContainsListBuilder() |
| 44 | + .build(), |
| 45 | + configuration |
| 46 | +); |
| 47 | +``` |
| 48 | + |
| 49 | +### Field Summary |
| 50 | +| Modifier and Type | Field and Description | |
| 51 | +| ----------------- | ---------------------- | |
| 52 | +| Set<Class<?>> | type = Set.of(List.class) | |
| 53 | +| Class<? extends JsonSchema> | items = [Items.class](#items) | |
| 54 | +| Class<? extends JsonSchema> | contains = [Contains.class](#contains) | |
| 55 | + |
| 56 | +### Method Summary |
| 57 | +| Modifier and Type | Method and Description | |
| 58 | +| ----------------- | ---------------------- | |
| 59 | +| [ItemsContainsList](#itemscontainslist) | validate([List<?>](#itemscontainslistbuilder) arg, SchemaConfiguration configuration) | |
| 60 | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | |
| 61 | +## ItemsContainsListBuilder |
| 62 | +public class ItemsContainsListBuilder<br> |
| 63 | +builder for `List<@Nullable Object>` |
| 64 | + |
| 65 | +A class that builds the List input type |
| 66 | + |
| 67 | +### Constructor Summary |
| 68 | +| Constructor and Description | |
| 69 | +| --------------------------- | |
| 70 | +| ItemsContainsListBuilder()<br>Creates an empty list | |
| 71 | +| ItemsContainsListBuilder(List<@Nullable Object> items)<br>Stores the items in a list | |
| 72 | + |
| 73 | +### Method Summary |
| 74 | +| Modifier and Type | Method and Description | |
| 75 | +| ----------------- | ---------------------- | |
| 76 | +| ItemsContainsListBuilder | add(Void item) | |
| 77 | +| ItemsContainsListBuilder | add(boolean item) | |
| 78 | +| ItemsContainsListBuilder | add(String item) | |
| 79 | +| ItemsContainsListBuilder | add(int item) | |
| 80 | +| ItemsContainsListBuilder | add(float item) | |
| 81 | +| ItemsContainsListBuilder | add(long item) | |
| 82 | +| ItemsContainsListBuilder | add(double item) | |
| 83 | +| ItemsContainsListBuilder | add(List<?> item) | |
| 84 | +| ItemsContainsListBuilder | add(Map<String, ?> item) | |
| 85 | +| List<@Nullable Object> | build()<br>Returns list input that should be used with Schema.validate | |
| 86 | + |
| 87 | +## ItemsContainsList |
| 88 | +public class ItemsContainsList<br> |
| 89 | +extends `FrozenList<@Nullable Object>` |
| 90 | + |
| 91 | +A class to store validated List payloads |
| 92 | + |
| 93 | +### Method Summary |
| 94 | +| Modifier and Type | Method and Description | |
| 95 | +| ----------------- | ---------------------- | |
| 96 | +| static [ItemsContainsList](#itemscontainslist) | of([List<? extends @Nullable Object>](#itemscontainslistbuilder) arg, SchemaConfiguration configuration) | |
| 97 | + |
| 98 | +## Items |
| 99 | +public static class Items<br> |
| 100 | +extends JsonSchema |
| 101 | + |
| 102 | +A schema class that validates payloads |
| 103 | + |
| 104 | +### Field Summary |
| 105 | +| Modifier and Type | Field and Description | |
| 106 | +| ----------------- | ---------------------- | |
| 107 | +| BigDecimal | multipleOf = new BigDecimal("2") | |
| 108 | + |
| 109 | +### Method Summary |
| 110 | +| Modifier and Type | Method and Description | |
| 111 | +| ----------------- | ---------------------- | |
| 112 | +| String | validate(String arg, SchemaConfiguration configuration) | |
| 113 | +| Void | validate(Void arg, SchemaConfiguration configuration) | |
| 114 | +| int | validate(int arg, SchemaConfiguration configuration) | |
| 115 | +| long | validate(long arg, SchemaConfiguration configuration) | |
| 116 | +| float | validate(float arg, SchemaConfiguration configuration) | |
| 117 | +| double | validate(double arg, SchemaConfiguration configuration) | |
| 118 | +| boolean | validate(boolean arg, SchemaConfiguration configuration) | |
| 119 | +| FrozenMap<String, @Nullable Object> | validate(Map<?, ?> arg, SchemaConfiguration configuration) | |
| 120 | +| FrozenList<@Nullable Object> | validate(List<?> arg, SchemaConfiguration configuration) | |
| 121 | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | |
| 122 | +## Contains |
| 123 | +public static class Contains<br> |
| 124 | +extends JsonSchema |
| 125 | + |
| 126 | +A schema class that validates payloads |
| 127 | + |
| 128 | +### Field Summary |
| 129 | +| Modifier and Type | Field and Description | |
| 130 | +| ----------------- | ---------------------- | |
| 131 | +| BigDecimal | multipleOf = new BigDecimal("3") | |
| 132 | + |
| 133 | +### Method Summary |
| 134 | +| Modifier and Type | Method and Description | |
| 135 | +| ----------------- | ---------------------- | |
| 136 | +| String | validate(String arg, SchemaConfiguration configuration) | |
| 137 | +| Void | validate(Void arg, SchemaConfiguration configuration) | |
| 138 | +| int | validate(int arg, SchemaConfiguration configuration) | |
| 139 | +| long | validate(long arg, SchemaConfiguration configuration) | |
| 140 | +| float | validate(float arg, SchemaConfiguration configuration) | |
| 141 | +| double | validate(double arg, SchemaConfiguration configuration) | |
| 142 | +| boolean | validate(boolean arg, SchemaConfiguration configuration) | |
| 143 | +| FrozenMap<String, @Nullable Object> | validate(Map<?, ?> arg, SchemaConfiguration configuration) | |
| 144 | +| FrozenList<@Nullable Object> | validate(List<?> arg, SchemaConfiguration configuration) | |
| 145 | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | |
| 146 | +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) |
0 commit comments