M
- Message type.E
- Exception type.MessageValidation
.@Deprecated public static class MessageValidator.Builder<M extends PMessage<M>,E extends Exception> extends Object
Modifier and Type | Method and Description |
---|---|
MessageValidator<M,E> |
build()
Deprecated.
Build the validator.
|
<M2 extends PMessage<M2>> |
expect(PField<M> field,
PMessageDescriptor<M2> descriptor,
Consumer<MessageValidator.Builder<M2,E>> builderConsumer)
Deprecated.
Given the field and type descriptor (which must match the field type),
build an inner validator to check the value of the field.
|
MessageValidator.Builder<M,E> |
expect(String text,
Predicate<M> predicate)
Deprecated.
Make a specific expectation for the message.
|
MessageValidator.Builder<M,E> |
expectMissing(PField<M>... fields)
Deprecated.
Expect field to be present on message.
|
MessageValidator.Builder<M,E> |
expectMissing(String text,
PField<M> field)
Deprecated.
Expect field to be present on message.
|
MessageValidator.Builder<M,E> |
expectNotNull()
Deprecated.
Expect the message to be non-null value.
|
MessageValidator.Builder<M,E> |
expectNotNull(String text)
Deprecated.
Expect the message to be non-null value.
|
MessageValidator.Builder<M,E> |
expectPresent(PField<M>... fields)
Deprecated.
Expect field to be present on message.
|
MessageValidator.Builder<M,E> |
expectPresent(String text,
PField<M> field)
Deprecated.
Expect field to be present on message.
|
@Nonnull public MessageValidator<M,E> build()
@Nonnull public MessageValidator.Builder<M,E> expect(@Nonnull String text, @Nonnull Predicate<M> predicate)
text
- The message text on expectation failure.predicate
- Expectation predicate.@Nonnull public <M2 extends PMessage<M2>> MessageValidator.Builder<M,E> expect(@Nonnull PField<M> field, @Nonnull PMessageDescriptor<M2> descriptor, @Nonnull Consumer<MessageValidator.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.@Nonnull public MessageValidator.Builder<M,E> expectNotNull()
@Nonnull public MessageValidator.Builder<M,E> expectNotNull(@Nonnull String text)
text
- The failure message on null value.@Nonnull @SafeVarargs public final MessageValidator.Builder<M,E> expectPresent(@Nonnull PField<M>... fields)
fields
- The fields to be present.@Nonnull public MessageValidator.Builder<M,E> expectPresent(@Nonnull String text, @Nonnull PField<M> field)
text
- The failure message on missing field.field
- The field to be present.@Nonnull @SafeVarargs public final MessageValidator.Builder<M,E> expectMissing(@Nonnull PField<M>... fields)
fields
- The fields to be present.Copyright © 2015–2020 morimekta.net. All rights reserved.