From e7f80b6f125672e2c1a827168ad69ddf1cf66422 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 15 Sep 2014 21:26:16 -0400 Subject: Add latest maven site. --- .../apidocs/com/tavianator/sangria/lazy/Lazy.html | 280 +++++++++++++++++++++ 1 file changed, 280 insertions(+) create mode 100644 latest/apidocs/com/tavianator/sangria/lazy/Lazy.html (limited to 'latest/apidocs/com/tavianator/sangria/lazy/Lazy.html') diff --git a/latest/apidocs/com/tavianator/sangria/lazy/Lazy.html b/latest/apidocs/com/tavianator/sangria/lazy/Lazy.html new file mode 100644 index 0000000..a38d874 --- /dev/null +++ b/latest/apidocs/com/tavianator/sangria/lazy/Lazy.html @@ -0,0 +1,280 @@ + + + + + + +Lazy (Sangria 1.2-SNAPSHOT API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.tavianator.sangria.lazy
+

Class Lazy<T>

+
+
+ +
+
    +
  • +
    +
    +
    public final class Lazy<T>
    +extends Object
    +
    A lazily-loaded dependency. Like a Provider, calling get() will produce an instance of T. + Unlike a Provider, the same instance will be returned for every future call to get(). Different + Lazy instances are independent and will return different instances from get(). + +

    + Lazy works automatically for unqualified bindings, as long as just-in-time bindings are enabled. For + qualified bindings, or if explicit bindings are requred, use LazyBinder: +

    + +
    + // Either separately...
    + bind(Dependency.class)
    +         .annotatedWith(Names.named("name"))
    +         .to(RealDependency.class);
    +
    + LazyBinder.create(binder())
    +         .bind(Dependency.class)
    +         .annotatedWith(Names.named("name"));
    +
    + // ... or in one go
    + LazyBinder.create(binder())
    +         .bind(Dependency.class)
    +         .annotatedWith(Names.named("name"))
    +         .to(RealDependency.class);
    +
    + ...
    +
    +  @Inject  @Named("name") Lazy<Dependency> lazy;
    + 
    +
    +
    Since:
    +
    1.2
    +
    Version:
    +
    1.2
    +
    Author:
    +
    Tavian Barnes (tavianator@tavianator.com)
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        get

        +
        public T get()
        +
        +
        Returns:
        +
        A lazily-produced value of type T.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + +

Copyright © 2014. All rights reserved.

+ + -- cgit v1.2.3