Class PersistenceElement

    • Constructor Detail

      • PersistenceElement

        public PersistenceElement()
        Create new PersistenceElement with no implementation. This constructor should only be used for cloning and archiving.
      • PersistenceElement

        protected PersistenceElement​(PersistenceElement.Impl impl)
        Create new PersistenceElement with the provided implementation. The implementation is responsible for storing all properties of the object.
        Parameters:
        impl - the implementation to use
    • Method Detail

      • getMessages

        protected static final ResourceBundle getMessages()
        Returns:
        I18N message handler for this element
      • getName

        public String getName()
        Get the name of this persistence element.
        Returns:
        the name
      • setName

        public void setName​(String name)
                     throws ModelException
        Set the name of this persistence element.
        Parameters:
        name - the name
        Throws:
        ModelException - if impossible
      • toString

        public String toString()
        Overrides Object's toString method to return the name of this persistence element.
        Overrides:
        toString in class Object
        Returns:
        a string representation of the object
      • equals

        public boolean equals​(Object obj)
        Overrides Object's equals method by comparing the name of this persistence element with the name of the argument obj. The method returns false if obj does not have the same dynamic type as this persistence element.
        Overrides:
        equals in class Object
        Parameters:
        obj - the reference object with which to compare.
        Returns:
        true if this object is the same as the obj argument; false otherwise.
      • hashCode

        public int hashCode()
        Overrides Object's hashCode method to return the hashCode of this persistence element's name.
        Overrides:
        hashCode in class Object
        Returns:
        a hash code value for this object.
      • compareTo

        public int compareTo​(Object o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The specified object must be persistence element, meaning it must be an instance of class PersistenceElement or any subclass. If not a ClassCastException is thrown. The order of PersistenceElement objects is defined by the order of their names. Persistence elements without name are considered to be less than any named persistence element.
        Specified by:
        compareTo in interface Comparable
        Parameters:
        o - the Object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Throws:
        ClassCastException - - if the specified object is null or is not an instance of PersistenceElement
      • setImpl

        public void setImpl​(PersistenceElement.Impl impl)
        Set the implementation factory of this persistence element. This method should only be used internally and for cloning and archiving.
        Parameters:
        impl - the implementation to use