org.joone.net
Class NetCheck
- java.lang.Object
-
- org.joone.net.NetCheck
-
- All Implemented Interfaces:
- java.lang.Comparable
public class NetCheck extends java.lang.Object implements java.lang.ComparableClass to represent a network validation check error. NetChecks of FATAL severity prevent the network from running, NetChecks of WARNING severity do not.
-
-
Field Summary
Fields Modifier and Type Field and Description static intFATALFatal check severity.static intWARNINGNon-fatal check severity.
-
Constructor Summary
Constructors Constructor and Description NetCheck(int severityArg, java.lang.String messageArg, java.lang.Object objectArg)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intcompareTo(java.lang.Object o)Method to order by message when in TreeSet.java.lang.StringgetMessage()Getter for the error messageintgetSeverity()Getter for the error severityjava.lang.ObjectgetSource()Getter for the object that caused the errorbooleanisFatal()Method to see if this check is a FATAL.booleanisWarning()Method to see if this check is a WARNING.voidsetMessage(java.lang.String message)Setter for the error messagevoidsetSeverity(int severity)Setter for the error severityvoidsetSource(java.lang.Object source)Setter for the object that caused the errorjava.lang.StringtoString()Produce a String representation of the check.
-
-
-
Field Detail
-
FATAL
public static final int FATAL
Fatal check severity.- See Also:
- Constant Field Values
-
WARNING
public static final int WARNING
Non-fatal check severity.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NetCheck
public NetCheck(int severityArg, java.lang.String messageArg, java.lang.Object objectArg)Constructor.- Parameters:
severityArg- the severity of the check. Should be FATAL or WARNING.messageArg- the message assosiated with the check.objectArg- the network component producing the check.
-
-
Method Detail
-
toString
public java.lang.String toString()
Produce a String representation of the check.- Overrides:
toStringin classjava.lang.Object- Returns:
- the String representation of the check.
-
isWarning
public boolean isWarning()
Method to see if this check is a WARNING.- Returns:
- true if warning.
-
isFatal
public boolean isFatal()
Method to see if this check is a FATAL.- Returns:
- true if error.
-
compareTo
public int compareTo(java.lang.Object o)
Method to order by message when in TreeSet.- Specified by:
compareToin interfacejava.lang.Comparable- Returns:
- true if error.
-
getSource
public java.lang.Object getSource()
Getter for the object that caused the error- Returns:
- the source object
-
setSource
public void setSource(java.lang.Object source)
Setter for the object that caused the error- Parameters:
source- the source object
-
getMessage
public java.lang.String getMessage()
Getter for the error message- Returns:
- the error message
-
setMessage
public void setMessage(java.lang.String message)
Setter for the error message- Parameters:
message- the error message
-
getSeverity
public int getSeverity()
Getter for the error severity- Returns:
- the error severity (either NetCheck.FATAL or NetCheck.WARNING)
-
setSeverity
public void setSeverity(int severity)
Setter for the error severity- Parameters:
severity- the error severity (either NetCheck.FATAL or NetCheck.WARNING)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG