Distinct

public final class Distinct extends FieldValidatingOption<T>

An option that can be applied to repeated and map Protobuf fields to specify that values represented by that field should not contain duplicates.

Functions

Link copied to clipboard
public Constraint constraintFor(FieldContext fieldValue)
Creates a Constraint for the given field based on the value of the option.
Link copied to clipboard
public static Distinct create()
Returns a new instance of this option.

Inherited functions

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
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(K object)

public Optional<T> valueFrom(FieldContext context)
Takes the value of the option from the given descriptor, given the specified context.
Link copied to clipboard
public boolean valuePresent(K object)