/*
InjectBuilderWebImpl(InjectorBuilder injectBuilder,
Function<?,T> fun)
{
Objects.requireNonNull(injectBuilder);
Objects.requireNonNull(fun);

_function = fun;

_builder = injectBuilder.function(fun);
}
425382
@Override
  public BindingBuilder<T> to(Class<? super T> api)
  {
    Objects.requireNonNull(api);
    
    _api = api;
    
    _builder.to(api);

    return this;
  }
434959
@Nonnull
	public <V1 extends T1, V2 extends T2> ToIntBiFunctionBuilder<T1, T2> aCase(Class<V1> argC1, Class<V2> argC2, ToIntBiFunction<V1, V2> function) {
		PartialCaseWithIntProduct.The pc = partialCaseFactoryMethod((a1, a2) -> (argC1 == null || argC1.isInstance(a1)) && (argC2 == null || argC2.isInstance(a2)));

		pc.evaluate(function);
		return self();
	}
1218433
@Nonnull
	public static <T> LOiToByteFunctionBuilder<T> oiToByteFunction(Consumer<LOiToByteFunction<T>> consumer) {
		return new LOiToByteFunctionBuilder(consumer);
	}
202036
@Override
    public Object create(ActionParameter argument, Context context, ParameterFactories engine) {
        if (argument.getRawType().equals(Context.class)) {
            return context;
        }

        // Check whether we have a ParameterFactory that can handle the creation.
        Set<Class> handled = engine.getTypesHandledByFactories();
        if (handled.contains(argument.getRawType())) {
            return engine.newInstance(context, argument.getRawType());
        }

        if (argument.getRawType().equals(Request.class)) {
            return context.request();
        }

        if (argument.getRawType().equals(SessionCookie.class)) {
            return context.session();
        }

        if (argument.getRawType().equals(FlashCookie.class)) {
            return context.flash();
        }

        if (argument.getRawType().equals(Cookie.class)) {
            if (!Strings.isNullOrEmpty(argument.getName())) {
                return context.cookie(argument.getName());
            } else {
                throw new IllegalArgumentException("Missing cookie's name set in the @HttpParameter annotation");
            }
        }

        if (argument.getRawType().equals(Route.class)) {
            return context.route();
        }

        if (argument.getRawType().equals(BufferedReader.class) || argument.getRawType().equals(Reader.class)) {
            try {
                return context.reader();
            } catch (IOException e) {
                throw new IllegalArgumentException("Cannot inject the reader object in the @HttpParameter injected " +
                        "parameter", e);
            }
        }

        // Ran out of possibilities based on the type, check for the request scope and then HTTP headers
        if (Strings.isNullOrEmpty(argument.getName())) {
            throw new IllegalArgumentException("Cannot inject the value of a HTTP header and request scope value in " +
                    "the @HttpParameter - header's name not defined");
        } else {
            final Object requestScopeValue = context.request().data().get(argument.getName());
            if (requestScopeValue != null) {
                return requestScopeValue;
            } else {
                if (context.header(argument.getName()) != null || argument.getDefaultValue() != null) {
                    return engine.convertValues(context.headers(argument.getName()), argument.getRawType(),
                            argument.getGenericType(), argument.getDefaultValue());
                } else {
                    // No value.
                    if (List.class.isAssignableFrom(argument.getRawType())) {
                        return Collections.emptyList();
                    }
                    if (Set.class.isAssignableFrom(argument.getRawType())) {
                        return Collections.emptySet();
                    }
                    if (Collections.class.isAssignableFrom(argument.getRawType())) {
                        return Collections.emptyList();
                    }
                    return null;
                }
            }
        }

    }
1300018
@Nonnull
	public static <T> LOiToByteFunction<T> oiToByteFunctionFrom(Consumer<LOiToByteFunctionBuilder<T>> buildingFunction) {
		LOiToByteFunctionBuilder builder = new LOiToByteFunctionBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
827573
function injectableWrapper(obj, provide, injects, isTransientScope) {
    // TODO(@davequick): discuss with @halfspiral whether isTransientScope might just better
    // be an array of Annotations
    var wrappedObject = function wrapOrCreateObject() {
      if(isFunction(obj) && (exists(obj.$provide) || exists(obj.$inject) || provide || injects)){
        var instance = Object.create(obj.prototype);
        return obj.apply(instance,arguments) || instance;
      }
      return obj;
    };
    return _wrapper(obj, wrappedObject, provide, injects, isTransientScope);
  }
1202764
function(object, callback) {
      return inject(object, null, function(state, key, value){
        if (state == undefined)
          return callIterator(callback, key, value) ? value : state
      })
    }
253381
private void compileJavaInteropBridgeConstructor( DynamicFunctionSymbol dfs )
  {
    DynamicFunctionSymbol copy = new DynamicFunctionSymbol( dfs );
    copy.setValue( null );
    copy.setInitializer( null );
    ConstructorStatement fs = new ConstructorStatement( true );
    fs.setDynamicFunctionSymbol( copy );
    fs.setSynthetic( true );
    MethodCallExpression expr = new MethodCallExpression();
    expr.setType( JavaTypes.pVOID() );
    List<ISymbol> args = dfs.getArgs();
    Expression[] exprArgs = new Expression[args.size()];
    for( int i = 0; i < args.size(); i++ )
    {
      ISymbol arg = args.get( i );

      Identifier id = new Identifier();
      id.setSymbol( arg, dfs.getSymbolTable() );
      id.setType( arg.getType() );
      exprArgs[i] = id;
    }
    expr.setArgs( exprArgs );
    expr.setFunctionSymbol( new ThisConstructorFunctionSymbol( dfs, true ) );
    MethodCallStatement stmt = new MethodCallStatement();
    stmt.setMethodCall( expr );
    stmt.setSynthetic( true );
    copy.setValue( stmt );
    copy.setDeclFunctionStmt( fs );

    int iModifiers = getModifiers( copy );

    List<IRSymbol> parameters = new ArrayList<>();
    maybeGetEnumSuperConstructorSymbols( parameters );
    for( ISymbol param : copy.getArgs() )
    {
      parameters.add( makeParamSymbol( copy, param ) );
    }

    setUpFunctionContext( copy, true, parameters );
    FunctionStatementTransformer funcStmtCompiler = new FunctionStatementTransformer( copy, _context );
    IRStatement methodBody = funcStmtCompiler.compile();
    IExpression annotationDefault = copy.getAnnotationDefault();
    Object[] annotationDefaultValue = null;
    if( annotationDefault != null )
    {
      annotationDefaultValue = new Object[] {CompileTimeExpressionParser.convertValueToInfoFriendlyValue( annotationDefault.evaluate(), getGosuClass().getTypeInfo() )};
    }

    IRMethodStatement methodStatement = new IRMethodStatement(
      methodBody,
      "<init>",
      iModifiers,
      copy.isInternal(),
      IRTypeConstants.pVOID(),
      copy.getReturnType(),
      parameters,
      copy.getArgTypes(),
      copy.getType(), annotationDefaultValue);

    methodStatement.setAnnotations( getIRAnnotations( makeAnnotationInfos( copy.getModifierInfo().getAnnotations(), getGosuClass().getTypeInfo() ) ) );
    _irClass.addMethod( methodStatement );
  }
217396
function injectAdditionalFunctions (funcs, additionalFunctions) {
  // Nothing to do if no additional function is given.
  if (no(additionalFunctions)) return

  /**
   * Validate and insert an additional function.
   */

  function injectAdditionalFunction (key) {
    var isAFunction = typeof additionalFunctions[key] === 'function'

    if (isAFunction) funcs[key] = additionalFunctions[key]
  }

  Object.keys(additionalFunctions)
    .forEach(injectAdditionalFunction)
}
272095
FunctionTypeBuilder inferKind(@Nullable JSDocInfo info) {
    if (info != null) {
      if (!NodeUtil.isMethodDeclaration(errorRoot)) {
        isConstructor = info.isConstructor();
        isInterface = info.isInterface();
        isRecord = info.usesImplicitMatch();
        makesStructs = info.makesStructs();
        makesDicts = info.makesDicts();
      }
      isAbstract = info.isAbstract();
    }
    if (isClass) {
      // If a CLASS literal has not been explicitly declared an interface, it's a constructor.
      // If it's not expicitly @dict or @unrestricted then it's @struct.
      isConstructor = !isInterface;
      makesStructs = info == null || (!makesDicts && !info.makesUnrestricted());
    }

    if (makesStructs && !(isConstructor || isInterface)) {
      reportWarning(CONSTRUCTOR_REQUIRED, "@struct", formatFnName());
    } else if (makesDicts && !isConstructor) {
      reportWarning(CONSTRUCTOR_REQUIRED, "@dict", formatFnName());
    }
    return this;
  }
294180
@Nonnull
	public static <T1, T2, R> LBiObjByteFunctionBuilder<T1, T2, R> biObjByteFunction() {
		return new LBiObjByteFunctionBuilder();
	}
1135622
@Nonnull
	public static <T> LObjDblConsumer<T> objDblConsumerFrom(Consumer<LObjDblConsumerBuilder<T>> buildingFunction) {
		LObjDblConsumerBuilder builder = new LObjDblConsumerBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
850457
private CodeBlock methodCallCodeWithJMapperTypeParameters( CodeBlock.Builder builder, ImmutableList<? extends JMapperType> parameters
    ) {
        return methodCallParametersCode( builder, Lists.transform( parameters, new Function<JMapperType, CodeBlock>() {

            @Override
            public CodeBlock apply( JMapperType jMapperType ) {
                return jMapperType.getInstance();
            }
        } ) );
    }
681738
function Injector(obj){
  var services = {};
  var get = name => {
    if(!(name in services)){
      const err = new Error(`[injector] service "${name}" not found`);
      return Promise.reject(err);
    }
    return services[name];
  };
  if(typeof obj === 'object')
    services = obj;
  if(typeof obj === 'function')
    get = obj;
  function resolve(name) {
    let service = get(name);
    if(typeof service === 'function')
      service = invoke(service);
    return service;
  };
  function invoke(fn, that){
    return Promise
    .all(getParameterNames(fn).map(resolve))
    .then(params => fn.apply(that, params));
  }
  return invoke;
}
58310
@Nonnull
	public static <T, R> LObjBiIntFunctionBuilder<T, R> objBiIntFunction(Consumer<LObjBiIntFunction<T, R>> consumer) {
		return new LObjBiIntFunctionBuilder(consumer);
	}
1064674
@Nonnull
	public static <T1, T2, R> LBiObjIntFunctionBuilder<T1, T2, R> biObjIntFunction() {
		return new LBiObjIntFunctionBuilder();
	}
883850
function createInjector(defType, parent, additionalProviders) {
    if (parent === void 0) { parent = null; }
    if (additionalProviders === void 0) { additionalProviders = null; }
    parent = parent || getNullInjector();
    return new R3Injector(defType, additionalProviders, parent);
}