Closed
Description
Expected Behavior
public class InMemoryRelyingPartyRegistrationRepository
implements IterableRelyingPartyRegistrationRepository {
Current Behavior
public class InMemoryRelyingPartyRegistrationRepository
implements RelyingPartyRegistrationRepository, Iterable<RelyingPartyRegistration> {
Context
A mess develops when you start adding custom implementations that are also iterable, and/or writing e.g. custom login pages that need to iterate through all registrations. Especially if you're trying to compose multiple repositories because they need different behaviour,
You either have to resort to unchecked casts, or unpleasant generics like <T extends RelyingPartyRegistrationRepository & Iterable<RelyingPartyRegistration>>
.
I assume it's too late to make RelyingPartyRegistrationRepository
extend Iterable<RelyingPartyRegistration>
or to add a method that returns a Collection<RelyingPartyRegistration>
?