FieldValidatingOption

public abstract class FieldValidatingOption<T> extends FieldOption<F> implements ValidatingOption<T, C, K>

An option that validates a field.

Validating options impose constraint on fields that they are applied to.

Parameters

<T>

type of value held by this option

Constructors

Link copied to clipboard
protected void FieldValidatingOption(GeneratedMessage.GeneratedExtension<DescriptorProtos.FieldOptions, T> optionExtension)
Specifies the extension that corresponds to this option.

Functions

Link copied to clipboard
protected T optionValue(FieldContext field)
Returns a value of the option.
Link copied to clipboard
public boolean shouldValidate(FieldContext context)
Returns true if this option exists for the specified field, false otherwise.
Link copied to clipboard
public Optional<T> valueFrom(FieldContext context)
Takes the value of the option from the given descriptor, given the specified context.

Inherited functions

Link copied to clipboard
public abstract Constraint constraintFor(C field)
Creates a Constraint for the given field based on the value of the option.
Link copied to clipboard
public boolean equals(Object o)
Link copied to clipboard
public GeneratedMessage.GeneratedExtension<E, T> extension()
Link copied to clipboard
public int hashCode()
Link copied to clipboard
protected abstract E optionsFrom(K p)
protected DescriptorProtos.FieldOptions optionsFrom(Descriptors.FieldDescriptor object)
Link copied to clipboard
public Optional<T> valueFrom(K object)
Link copied to clipboard
public boolean valuePresent(K object)

Inheritors

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