Class CSVMessageDescriptor

  • All Implemented Interfaces:
    java.lang.Comparable<CSVMessageDescriptor>

    public class CSVMessageDescriptor
    extends java.lang.Object
    implements java.lang.Comparable<CSVMessageDescriptor>
    Describe an error that occurred during the reading of a CSV file.
    • Constructor Detail

      • CSVMessageDescriptor

        public CSVMessageDescriptor()
        Default constructor
      • CSVMessageDescriptor

        public CSVMessageDescriptor​(CSVMessageLevel messageLevel,
                                    int nLineNumber,
                                    java.lang.String strMessageContent)
        Creates a new CSVMessageDescriptor with every attributes initialized
        Parameters:
        messageLevel - The level of the message
        nLineNumber - The number of the line associated with the message
        strMessageContent - The content of the message
    • Method Detail

      • getMessageLevel

        public CSVMessageLevel getMessageLevel()
        Get the level of the message
        Returns:
        The level of the message
      • setMessageLevel

        public void setMessageLevel​(CSVMessageLevel messageLevel)
        Set the level of the message
        Parameters:
        messageLevel - the level of the message
      • getLineNumber

        public int getLineNumber()
        Get the number of the line of the CSV file associated with this message.
        Returns:
        The number of the line of the CSV file associated with this message.
      • setLineNumber

        public void setLineNumber​(int nLineNumber)
        Set the number of the line of the CSV file associated with this error.
        Parameters:
        nLineNumber - The number of the line of the CSV file associated with this error.
      • getMessageContent

        public java.lang.String getMessageContent()
        Get the description of the message
        Returns:
        The description of the message
      • setMessageContent

        public void setMessageContent​(java.lang.String strMessageContent)
        Set the description of the message
        Parameters:
        strMessageContent - The description of the message
      • compareTo

        public int compareTo​(CSVMessageDescriptor o)
        compare this CSVMessageDescriptor with another.
        This method returns 0 for objects that are not equals ! Use with care in collections !
        Specified by:
        compareTo in interface java.lang.Comparable<CSVMessageDescriptor>
        Parameters:
        o - Object to compare to
        Returns:
        Returns :
        • -1 if the line number of this object is greater than the line number of the other object, or if this object has an INFO level and the other one an ERROR level if they have the same line number.
        • 0 if they both have the same line number and level, regardless of their description
        • 1 if the other object is null, if its line number if greater than the line number of the current object, or if this object has a ERROR level whereas the other has the INFO level if they have the same line number.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object