Skip to content

Commit

Permalink
Allow for a default on the isSingle (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLimeGlass authored Jan 1, 2024
1 parent 2c83253 commit e954013
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,20 @@ public <C extends Expression<T>, T> ExpressionRegistrar<C, T> newExpression(Clas
return new ExpressionRegistrar<>(c, returnType, isSingle, patterns);
}

/**
* Registers an {@link Expression} with the isSingle set to true by default.
* Mainly so you can override with {@link Expression#isSingle()}
*
* @param c the Expression's class
* @param returnType the Expression's return type
* @param patterns the Expression's patterns
* @param <C> the Expression
* @param <T> the Expression's return type
*/
public <C extends Expression<T>, T> void addExpression(Class<C> c, Class<T> returnType, String... patterns) {
newExpression(c, returnType, true, patterns).register();
}

/**
* Registers an {@link Expression}
* @param c the Expression's class
Expand Down

0 comments on commit e954013

Please sign in to comment.