FieldConstraint

public abstract class FieldConstraint<V> implements Constraint

A rule that limits a set of values that a Protobuf field can have.

Parameters

<V>

a type of value that describes the constraints

Constructors

Link copied to clipboard
protected void FieldConstraint(V optionValue, FieldDeclaration field)
Creates a new instance of this constraint.

Functions

Link copied to clipboard
public final FieldDeclaration field()
Link copied to clipboard
public final V optionValue()
Returns a value that describes the constraint.
Link copied to clipboard
public MessageType targetType()
The associated message type.

Inherited functions

Link copied to clipboard
public abstract void accept(ConstraintTranslator<? extends Object> visitor)
Accepts the given ConstraintTranslator.
Link copied to clipboard
public abstract String errorMessage(FieldContext field)
Produces an error message for the given field validation context.

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard