fr.paris.lutece.portal.service.csv
Class CSVMessageDescriptor

java.lang.Object
  extended by fr.paris.lutece.portal.service.csv.CSVMessageDescriptor
All Implemented Interfaces:
Comparable<CSVMessageDescriptor>

public class CSVMessageDescriptor
extends Object
implements Comparable<CSVMessageDescriptor>

Describe an error that occurred during the reading of a CSV file.


Constructor Summary
CSVMessageDescriptor()
          Default constructor
CSVMessageDescriptor(CSVMessageLevel messageLevel, int nLineNumber, String strMessageContent)
          Creates a new CSVMessageDescriptor with every attributes initialized
 
Method Summary
 int compareTo(CSVMessageDescriptor o)
          compare this CSVMessageDescriptor with another.
 int getLineNumber()
          Get the number of the line of the CSV file associated with this message.
 String getMessageContent()
          Get the description of the message
 CSVMessageLevel getMessageLevel()
          Get the level of the message
 void setLineNumber(int nLineNumber)
          Set the number of the line of the CSV file associated with this error.
 void setMessageContent(String strMessageContent)
          Set the description of the message
 void setMessageLevel(CSVMessageLevel messageLevel)
          Set the level of the message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVMessageDescriptor

public CSVMessageDescriptor()
Default constructor


CSVMessageDescriptor

public CSVMessageDescriptor(CSVMessageLevel messageLevel,
                            int nLineNumber,
                            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 String getMessageContent()
Get the description of the message

Returns:
The description of the message

setMessageContent

public void setMessageContent(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 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.


Copyright © 2014 Mairie de Paris. All Rights Reserved.