Class HibernateObjectIdentityImpl

  • All Implemented Interfaces:
    Serializable, org.acegisecurity.acls.objectidentity.ObjectIdentity

    public class HibernateObjectIdentityImpl
    extends Object
    implements org.acegisecurity.acls.objectidentity.ObjectIdentity
    See Also:
    Serialized Form
    • Constructor Detail

      • HibernateObjectIdentityImpl

        public HibernateObjectIdentityImpl​(String javaType,
                                           @NotNull
                                           @NotNull Serializable identifier)
      • HibernateObjectIdentityImpl

        public HibernateObjectIdentityImpl​(@NotNull
                                           @NotNull Class javaType,
                                           @NotNull
                                           @NotNull Serializable identifier)
      • HibernateObjectIdentityImpl

        public HibernateObjectIdentityImpl​(@NotNull
                                           @NotNull Object object)
                                    throws org.acegisecurity.acls.IdentityUnavailableException
        Creates the ObjectIdentityImpl based on the passed object instance. The passed object must provide a getId() method, otherwise an exception will be thrown. The object passed will be considered the javaType, so if more control is required, an alternate constructor should be used instead.
        Parameters:
        object - the domain object instance to create an identity for
        Throws:
        org.acegisecurity.acls.IdentityUnavailableException - if identity could not be extracted
      • HibernateObjectIdentityImpl

        public HibernateObjectIdentityImpl​(@NotNull
                                           @NotNull BambooIdProvider object)
        Creates the ObjectIdentityImpl based on the passed object instance. The object passed will be considered the javaType, so if more control is required, an alternate constructor should be used instead.
        Parameters:
        object - the domain object instance to create an identity for
    • Method Detail

      • equals

        public boolean equals​(Object arg0)
        Important so caching operates properly.

        Considers an object of the same class equal if it has the same classname and id properties.

        Specified by:
        equals in interface org.acegisecurity.acls.objectidentity.ObjectIdentity
        Overrides:
        equals in class Object
        Parameters:
        arg0 - object to compare
        Returns:
        true if the presented object matches this object
      • hashCode

        public int hashCode()
        Important so caching operates properly.
        Specified by:
        hashCode in interface org.acegisecurity.acls.objectidentity.ObjectIdentity
        Overrides:
        hashCode in class Object
        Returns:
        the hash
      • getIdentifier

        public Serializable getIdentifier()
        Specified by:
        getIdentifier in interface org.acegisecurity.acls.objectidentity.ObjectIdentity
      • getJavaType

        public Class getJavaType()
        Specified by:
        getJavaType in interface org.acegisecurity.acls.objectidentity.ObjectIdentity