From 278bfc319cc905bdf150af814bb3461896b68444 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 25 Oct 2015 13:35:25 -0400 Subject: Add version 1.3.1 site. --- .../apidocs/com/tavianator/sangria/lazy/Lazy.html | 280 +++++++++++++++++++++ 1 file changed, 280 insertions(+) create mode 100644 1.3.1/apidocs/com/tavianator/sangria/lazy/Lazy.html (limited to '1.3.1/apidocs/com/tavianator/sangria/lazy/Lazy.html') diff --git a/1.3.1/apidocs/com/tavianator/sangria/lazy/Lazy.html b/1.3.1/apidocs/com/tavianator/sangria/lazy/Lazy.html new file mode 100644 index 0000000..d20b30d --- /dev/null +++ b/1.3.1/apidocs/com/tavianator/sangria/lazy/Lazy.html @@ -0,0 +1,280 @@ + + + + + + +Lazy (Sangria 1.3.1 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–2015. All rights reserved.

+ + -- cgit v1.2.3