Class CampaignOption<T>

java.lang.Object
mekhq.campaign.campaignOptions.CampaignOption<T>
Type Parameters:
T - the type of the option's value

public final class CampaignOption<T> extends Object
A typed key identifying a single campaign option.

Each constant carries the option's value type (type()), its default value (defaultValue()), and the XML tag under which it is persisted (xmlTag()). Because the key itself is parameterized by T, a heterogeneous store keyed on CampaignOption can offer a single, fully compile-time-checked accessor pair (get/set) without casts or type tokens at the call site (the typesafe heterogeneous container pattern, Effective Java Item 33).

A Java enum cannot be generic per-constant, so this is a final class of public static final constants rather than an enum. Constants self-register into values() on creation so a store can seed every managed option from its declared default.