Modifier and Type | Method and Description |
---|---|
MessageValidation<M,E> |
build()
Build the validator.
|
MessageValidation.Builder<M,E> |
expect(MessageValidation.Expectation<M> expectation)
Make a specific expectation for the message.
|
MessageValidation.Builder<M,E> |
expect(MessageValidation.SimpleExpectation<M> expectation)
Make a specific expectation for the message.
|
<V> MessageValidation.Builder<M,E> |
expectIfPresent(PField<M> field,
MessageValidation.Expectation<V> valueExpectation)
Given the field and type descriptor (which must match the field type),
build an inner validator to check the value of the field.
|
<V> MessageValidation.Builder<M,E> |
expectIfPresent(PField<M> field,
MessageValidation.SimpleExpectation<V> valueExpectation)
Given the field and type descriptor (which must match the field type),
build an inner validator to check the value of the field.
|
<M2 extends PMessage<M2>> |
expectIfPresent(PField<M> field,
PMessageDescriptor<M2> descriptor,
Consumer<MessageValidation.Builder<M2,E>> builderConsumer)
Given the field and type descriptor (which must match the field type),
build an inner validator to check the value of the field.
|
MessageValidation.Builder<M,E> |
expectMissing(PField<M>... fields)
Expect field to be present on message.
|
MessageValidation.Builder<M,E> |
expectNotNull()
Expect the message to be non-null value.
|
MessageValidation.Builder<M,E> |
expectPresent(PField<M>... fields)
Expect field to be present on message.
|
@Nonnull public MessageValidation<M,E> build()
@Nonnull public MessageValidation.Builder<M,E> expectNotNull()
@Nonnull @SafeVarargs public final MessageValidation.Builder<M,E> expectPresent(@Nonnull PField<M>... fields)
fields
- The fields to be present.@Nonnull @SafeVarargs public final MessageValidation.Builder<M,E> expectMissing(@Nonnull PField<M>... fields)
fields
- The fields to be present.@Nonnull public MessageValidation.Builder<M,E> expect(@Nonnull MessageValidation.SimpleExpectation<M> expectation)
expectation
- Expectation predicate.@Nonnull public MessageValidation.Builder<M,E> expect(@Nonnull MessageValidation.Expectation<M> expectation)
expectation
- Expectation predicate.@Nonnull public <V> MessageValidation.Builder<M,E> expectIfPresent(@Nonnull PField<M> field, @Nonnull MessageValidation.SimpleExpectation<V> valueExpectation)
V
- The inner message type.field
- The field to check.valueExpectation
- Expectation of field value.@Nonnull public <V> MessageValidation.Builder<M,E> expectIfPresent(@Nonnull PField<M> field, @Nonnull MessageValidation.Expectation<V> valueExpectation)
V
- The inner message type.field
- The field to check.valueExpectation
- Expectation of field value.@Nonnull public <M2 extends PMessage<M2>> MessageValidation.Builder<M,E> expectIfPresent(@Nonnull PField<M> field, @Nonnull PMessageDescriptor<M2> descriptor, @Nonnull Consumer<MessageValidation.Builder<M2,E>> builderConsumer)
M2
- The inner message type.field
- The field to check.descriptor
- The message descriptor matching the field.builderConsumer
- Consumer to configure the inner validator.Copyright © 2015–2020 morimekta.net. All rights reserved.