Class IdAbleImpl

    • Constructor Detail

      • IdAbleImpl

        public IdAbleImpl​(long id)
        constructor
        Parameters:
        id - to use
      • IdAbleImpl

        public IdAbleImpl​(IdAbleImpl other)
        Copy constructor
        Parameters:
        other - to copy from
    • Method Detail

      • generateAndSetId

        protected long generateAndSetId​(Class<?> classIdentifier,
                                        IdGroupingToken idtoken)
        Convenience method to generate and set the id using a unique class identifier and idToken which in turn delegates to the IdGenerator.generateId()
        Parameters:
        classIdentifier - to use
        idtoken - to use
        Returns:
        generated and set id
      • generateId

        protected static long generateId​(IdGroupingToken idGroupingToken,
                                         Class<? extends IdAble> clazz)
        Generate an id based on provided token and class
        Parameters:
        idGroupingToken - to use
        clazz - to register for
        Returns:
        generated id
      • setId

        protected void setId​(long id)
        set the id
        Parameters:
        id - to set
      • getId

        public long getId()
        Collect id of the entity
        Specified by:
        getId in interface IdAble
        Returns:
        id found
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • shallowClone

        public abstract IdAble shallowClone()
        Create a shallow copy of this entity
        Specified by:
        shallowClone in interface IdAble
        Returns:
        shallow copy of entity
      • deepClone

        public abstract IdAble deepClone()
        An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call. To be used with caution if not called by managed id container related code
        Specified by:
        deepClone in interface IdAble
        Returns:
        deep copy of entity