Struct MandatoryValue

UDA used for marking class members which should be value-injected.

struct MandatoryValue ;

When the injector throws a ValueNotAvailableException, it is re-thrown instead of being suppressed.

A key must be supplied, which can be in any format depending on how a value injector reads it.

Fields

NameTypeDescription
key stringThe textual key used to find the value by injectors.

Examples

class MyClass {
    @MandatoryValue("general.valueWhichShouldBeThere")
    private int number;
}