/** * Coerce a Grapht context to a LensKit context. * * @param ctx The context. * @return A LensKit context, as a wrapper if necessary. */ protected static LenskitConfigContext wrapContext(Context ctx) { if (ctx instanceof LenskitConfigContext) { return (LenskitConfigContext) ctx; } else { return new ContextWrapper(ctx); } }
/** * Coerce a Grapht context to a LensKit context. * * @param ctx The context. * @return A LensKit context, as a wrapper if necessary. */ protected static LenskitConfigContext wrapContext(Context ctx) { if (ctx instanceof LenskitConfigContext) { return (LenskitConfigContext) ctx; } else { return new ContextWrapper(ctx); } }