protected BasicSensor(Class<T> type, TypeToken<T> typeToken, String name, String description) { TypeTokens.checkCompatibleOneNonNull(type, typeToken); this.typeToken = typeToken; this.type = type; this.name = checkNotNull(name, "name"); this.description = description; }
public BasicConfigKey(Builder<T,?> builder) { this.name = checkNotNull(builder.name, "name"); this.deprecatedNames = checkNotNull(builder.deprecatedNames, "deprecatedNames"); TypeTokens.checkCompatibleOneNonNull(builder.type, builder.typeToken); this.type = builder.type; this.typeToken = builder.typeToken; this.description = builder.description; this.defaultValue = builder.defaultValue; this.reconfigurable = builder.reconfigurable; this.runtimeInheritance = builder.runtimeInheritance; this.typeInheritance = builder.typeInheritance; // Note: it's intentionally possible to have default values that are not valid // per the configured constraint. If validity were checked here any class that // contained a weirdly-defined config key would fail to initialise. this.constraint = checkNotNull(builder.constraint, "constraint"); }