Class AbstractSQLCoreProvider.ColumnFeature<U extends AbstractSQLCoreProvider.SQLUser, T>
java.lang.Object
pro.gravit.launchserver.auth.core.AbstractSQLCoreProvider.ColumnFeature<U,T>
- Type Parameters:
U- the concreteAbstractSQLCoreProvider.SQLUsersubtype this feature reads intoT- the Java type of the value held in the column
- Enclosing class:
AbstractSQLCoreProvider
public static final class AbstractSQLCoreProvider.ColumnFeature<U extends AbstractSQLCoreProvider.SQLUser, T>
extends Object
Describes a single optional column in the user table.
A ColumnFeature is enabled when its columnName is non-null.
When disabled, it is silently excluded from every SQL fragment — SELECT column list,
UPDATE statements, and ResultSet mapping — with no branching required at the call site.
Instances are registered via
AbstractSQLCoreProvider.registerColumnFeature(ColumnFeature) inside
AbstractSQLCoreProvider.registerOptionalColumns().
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstruewhencolumnNameis non-null (feature is active).static <U extends AbstractSQLCoreProvider.SQLUser, T>
AbstractSQLCoreProvider.ColumnFeature<U, T> of(String columnName, BiConsumer<U, ResultSet> reader) Creates an enabled feature backed by a custom reader lambda.static <U extends AbstractSQLCoreProvider.SQLUser>
AbstractSQLCoreProvider.ColumnFeature<U, String> Convenience factory for columns whose value is aStringmapped viaResultSet.getString(String)and stored through a setter.voidread(AbstractSQLCoreProvider.SQLUser user, ResultSet rs) Reads this column fromrsintouser.
-
Field Details
-
columnName
Name of the database column.nullmeans the feature is disabled — it will be excluded from all SQL and ResultSet access.
-
-
Method Details
-
of
public static <U extends AbstractSQLCoreProvider.SQLUser, T> AbstractSQLCoreProvider.ColumnFeature<U,T> of(String columnName, BiConsumer<U, ResultSet> reader) Creates an enabled feature backed by a custom reader lambda.ColumnFeature.of(totpColumn, (user, rs) -> user.totpSecret = rs.getString(totpColumn)) -
ofString
public static <U extends AbstractSQLCoreProvider.SQLUser> AbstractSQLCoreProvider.ColumnFeature<U,String> ofString(String columnName, Function<ResultSet, String> extractor, BiConsumer<U, String> setter) Convenience factory for columns whose value is aStringmapped viaResultSet.getString(String)and stored through a setter.ColumnFeature.ofString(totpColumn, rs -> rs.getString(totpColumn), (user, val) -> user.totpSecret = val) -
isEnabled
public boolean isEnabled()ReturnstruewhencolumnNameis non-null (feature is active). -
read
- Throws:
SQLException- propagated fromResultSetaccess
-