ifSupport<T> function

T ifSupport<T>(
  1. RuleContext ctx,
  2. Supplier<T?> support
)

Implementation

T ifSupport<T>(RuleContext ctx, Supplier<T?> support) {
  final t = support();
  if (t == null) {
    throw UnsupportedTypeContextException(ctx);
  }
  return t;
}