Hi,

How can I mix optional parameters into a constructor with
AssistedInject? For example:

public class Resource
{
  @Inject
  public Resource(@Assisted URI uri, Helper helper)
  {...}

  public static interface Builder
  {
    /**
     * Create a new resource (uri is null).
     */
    Resource create();

    /**
     * Load an existing resource (uri is non-null).
     */
    Resource load(URI uri);
  }
}

I tried this:

public class Resource
{
  @Inject
  public Resource(UriHolder uri, Helper helper)
  {...}

  static class UriHolder
  {
        @Inject(optional=true) @Assisted URI value;
  }
}

but UriHolder.uri is always null. Any ideas?

Thanks,
Gili

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to