added createTarget method on Essence class to allow subclassing.
This commit is contained in:
parent
b5cbc977e1
commit
92dcf694b4
|
@ -109,7 +109,7 @@ public class LdapUserDetailsImpl implements LdapUserDetails {
|
|||
* Variation of essence pattern. Used to create mutable intermediate object
|
||||
*/
|
||||
public static class Essence {
|
||||
LdapUserDetailsImpl instance = new LdapUserDetailsImpl();
|
||||
LdapUserDetailsImpl instance = createTarget();
|
||||
List mutableAuthorities = new ArrayList();
|
||||
|
||||
public Essence() {}
|
||||
|
@ -127,6 +127,10 @@ public class LdapUserDetailsImpl implements LdapUserDetails {
|
|||
setAuthorities(copyMe.getAuthorities());
|
||||
}
|
||||
|
||||
LdapUserDetailsImpl createTarget() {
|
||||
return new LdapUserDetailsImpl();
|
||||
}
|
||||
|
||||
public Essence addAuthority(GrantedAuthority a) {
|
||||
mutableAuthorities.add(a);
|
||||
|
||||
|
|
Loading…
Reference in New Issue