Skip to content

Replace class-level @FlagDesc with @InjectFlags #10

Description

@yin

The interface will mark a class as subject for Flag value injection during classpath scanning. It will also provide hints to the flag injector, like the flag variable prefix, intended to allow for more concise code.

public @interface InjectFlags {
Stringprefix() default"";
}

The prefix hint allows for concise naming convention and resolves collisions with instance variables:

@InjectFlags(prefix = "flag_")
classMyThing {
@FlagDesc("This tells me what to '--do'...")
staticFlag<String> flag_do = Flags.create("Rest!");
finalStringdo;
MyThing() {
this.do = flag_do.get();
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions