/** * This interface provides a validation method that can be configured with a predicate. */ @Functional public static interface Key<K> { /** * Returns the validator which validates the keys. */ @Pure @Default("object -> true") public @Nonnull Predicate<? super K> getKeyValidator(); /** * Returns whether the given key is valid. */ @Pure public default boolean isValidKey(K key) { return getKeyValidator().evaluate(key); } }
/** * This interface provides a validation method that can be configured with a predicate. */ @Functional public static interface Value<V> { /** * Returns the validator which validates the values. */ @Pure @Default("object -> true") public @Nonnull Predicate<? super V> getValueValidator(); /** * Returns whether the given value is valid. */ @Pure public default boolean isValid(V value) { return getValueValidator().evaluate(value); } }
@Functional public interface Countable {
@Functional public interface CustomComparable<T extends CustomComparable<T>> extends Comparable<T> {
@Functional public interface LongNumerical<T extends LongNumerical<T>> extends CustomComparable<T> {
@Functional public interface BigIntegerNumerical<T extends BigIntegerNumerical<T>> extends CustomComparable<T> {
/** * Objects that implement this interface can be used to observe a {@link Configuration configuration}. */ @Functional public static interface Observer<@Unspecifiable PROVIDER> { /** * This method is called on {@link Configuration#register(net.digitalid.utility.configuration.Configuration.Observer) registered} observers when the provider of the given configuration has been replaced. * * @require !newProvider.equals(oldProvider) : "The new provider may not the same as the old provider."; */ public void notify(@Nonnull Configuration<PROVIDER> configuration, @Nullable PROVIDER oldProvider, @Nonnull PROVIDER newProvider); }
/** * Objects that implement this interface can be used to {@link Property#register(net.digitalid.utility.property.Observer) observe} {@link ReadOnlyVolatileValueProperty volatile value properties}. */ @Mutable @Functional public interface VolatileValueObserver<@Specifiable VALUE> extends ValueObserver<VALUE, RuntimeException, RuntimeException, VolatileValueObserver<VALUE>, ReadOnlyVolatileValueProperty<VALUE>> {}
@Functional public interface AnnotationHandler {
@Functional public interface Threading {
@Functional public interface UnaryOperator<TYPE> extends UnaryFunction<TYPE, TYPE>, FailableUnaryOperator<TYPE, RuntimeException> {
/** * Objects that implement this interface can be used to {@link Property#register(net.digitalid.utility.property.Observer) observe} {@link ReadOnlyVolatileSetProperty volatile set properties}. */ @Mutable @Functional public interface VolatileSetObserver<@Unspecifiable VALUE, @Unspecifiable READONLY_SET extends ReadOnlySet<@Nonnull @Valid VALUE>> extends SetObserver<VALUE, READONLY_SET, RuntimeException, RuntimeException, VolatileSetObserver<VALUE, READONLY_SET>, ReadOnlyVolatileSetProperty<VALUE, READONLY_SET>> {}
@Functional public interface Consumer<@Specifiable INPUT> extends FailableConsumer<INPUT, RuntimeException> {
/** * Objects that implement this interface can be used to {@link Property#register(net.digitalid.utility.property.Observer) observe} {@link ReadOnlyVolatileMapProperty volatile map properties}. */ @Mutable @Functional public interface VolatileMapObserver<@Unspecifiable KEY, @Unspecifiable VALUE, @Unspecifiable READONLY_MAP extends ReadOnlyMap<@Nonnull @Valid("key") KEY, @Nonnull @Valid VALUE>> extends MapObserver<KEY, VALUE, READONLY_MAP, RuntimeException, RuntimeException, VolatileMapObserver<KEY, VALUE, READONLY_MAP>, ReadOnlyVolatileMapProperty<KEY, VALUE, READONLY_MAP>> {}
@Functional public interface BinaryOperator<@Specifiable TYPE> extends BinaryFunction<TYPE, TYPE, TYPE>, FailableBinaryOperator<TYPE, RuntimeException> {
@Functional public interface Producer<@Specifiable OUTPUT> extends FailableProducer<OUTPUT, RuntimeException> {
@Functional public interface UnaryFunction<@Specifiable INPUT, @Specifiable OUTPUT> extends FailableUnaryFunction<INPUT, OUTPUT, RuntimeException> {
/** * Objects that implement this interface can be used to {@link Property#register(net.digitalid.utility.property.Observer) observe} {@link ReadOnlySetProperty set properties}. * * @see VolatileSetObserver */ @Mutable @Functional public interface SetObserver<@Unspecifiable VALUE, @Unspecifiable READONLY_SET extends ReadOnlySet<@Nonnull @Valid VALUE>, @Unspecifiable EXCEPTION1 extends Exception, @Unspecifiable EXCEPTION2 extends Exception, @Unspecifiable OBSERVER extends SetObserver<VALUE, READONLY_SET, EXCEPTION1, EXCEPTION2, OBSERVER, PROPERTY>, @Unspecifiable PROPERTY extends ReadOnlySetProperty<VALUE, READONLY_SET, EXCEPTION1, EXCEPTION2, OBSERVER, PROPERTY>> extends Observer { /** * This method is called on {@link Property#isRegistered(net.digitalid.utility.property.Observer) registered} observers when a value has been added to or removed from the given property. * * @param added {@code true} if the given value has been added to or {@code false} if it has been removed from the given property. */ @Impure public void notify(@Nonnull PROPERTY property, @NonCaptured @Unmodified @Nonnull @Valid VALUE value, boolean added); }
/** * Objects that implement this interface can be used to {@link Property#register(net.digitalid.utility.property.Observer) observe} {@link ReadOnlyValueProperty value properties}. * * @see VolatileValueObserver */ @Mutable @Functional public interface ValueObserver<@Specifiable VALUE, @Unspecifiable EXCEPTION1 extends Exception, @Unspecifiable EXCEPTION2 extends Exception, @Unspecifiable OBSERVER extends ValueObserver<VALUE, EXCEPTION1, EXCEPTION2, OBSERVER, PROPERTY>, @Unspecifiable PROPERTY extends ReadOnlyValueProperty<VALUE, EXCEPTION1, EXCEPTION2, OBSERVER, PROPERTY>> extends Observer { /** * This method is called on {@link Property#isRegistered(net.digitalid.utility.property.Observer) registered} observers when the value of the given property has been replaced. * * @require !Objects.equals(newValue, oldValue) : "The new value may not be the same as the old value."; */ @Impure public void notify(@Nonnull PROPERTY property, @NonCaptured @Unmodified @Valid VALUE oldValue, @NonCaptured @Unmodified @Valid VALUE newValue); }
@Functional public interface BinaryFunction<@Specifiable INPUT0, @Specifiable INPUT1, @Specifiable OUTPUT> extends FailableBinaryFunction<INPUT0, INPUT1, OUTPUT, RuntimeException> {