I'm doing an exercise with @Inject
of package javax.inject
and I have no problem for example when in a class I think something like this
public class Persona {
@Inject
private Rol rol;
}
but when I try to do the following, it shows me that it is ambiguous
public class Persona {
@Inject
private Rol rol;
@Inject
private List<Rol> roles;
}
I know I can use Qualifiers but the issue is that it's the same class I want to have role as a single object and roles as multiple role objects,
So far I only inject the single object and the list of roles initialize it in the normal way
List<Rol> roles = new ArrayList<>();