From 7865786d43805a7e45240088b9de77e37b485c3e Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 8 May 2015 20:53:48 -0400 Subject: Add version 1.3 site. --- 1.3/apidocs/com/tavianator/sangria/lazy/Lazy.html | 260 ++++++++++++++++++++++ 1 file changed, 260 insertions(+) create mode 100644 1.3/apidocs/com/tavianator/sangria/lazy/Lazy.html (limited to '1.3/apidocs/com/tavianator/sangria/lazy/Lazy.html') diff --git a/1.3/apidocs/com/tavianator/sangria/lazy/Lazy.html b/1.3/apidocs/com/tavianator/sangria/lazy/Lazy.html new file mode 100644 index 0000000..bda78af --- /dev/null +++ b/1.3/apidocs/com/tavianator/sangria/lazy/Lazy.html @@ -0,0 +1,260 @@ + + + + + + +Lazy (Sangria 1.3 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