support updating objectClasses for a User

This PR does a few things:

- moves existing deactivatedUid and new objectClass meta-data to a common implementation meta-data HashMap.
- implementation meta-data is not observed for object equality
- updates objectClasses based on current state of User object
- always updates objectClass on object update
I think that's acceptable. I agree it would overcomplicate the code using
reflection to determine type information. I suppose Java using Type Erasure
leaves us no other option.

On Thu, Dec 11, 2014 at 2:36 PM, Daniel Frett <notifications@github.com>
wrote:

> In
> ldaptive/src/main/java/org/ccci/idm/user/ldaptive/dao/mapper/AbstractUserLdapEntryMapper.java
> <https://github.com/GlobalTechnology/idm-user-management/pull/30#discussion-diff-21702782>
> :
>
> > @@ -323,14 +331,23 @@ protected final LdapAttribute attr(final String name, final ReadableInstant... v
> >      }
> >
> >      protected LdapAttribute attrObjectClass(final O user) {
> > -        final LdapAttribute attr = new LdapAttribute(LDAP_ATTR_OBJECTCLASS, LDAP_OBJECTCLASSES_USER);
> > +        // get any existing object classes
> > +        @SuppressWarnings("unchecked")
>
> java uses Type Erasure, which means generics are only available at compile
> time and are erased prior to runtime (no difference between HashSet and
> HashSet at runtime).
>
> our usage of Class is to perform runtime checking to reduce unchecked
> casts as much as possible.
>
> Supposedly it is possible to get the generic type information for objects
> using reflection at runtime, but that would complicate the code for
> internal meta-data and I think we would still need to do "unchecked" casts
> from the compilers point of view.
>
> I'm opting for documenting that the *ImplMeta() methods as intended for
> internal use only.
>
> see:
> http://stackoverflow.com/questions/1942644/get-generic-type-of-java-util-list
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/GlobalTechnology/idm-user-management/pull/30/files#r21702782>
> .
>