Package org.zaproxy.zap.view.table
Class AlertRiskTableCellItem
- java.lang.Object
-
- org.zaproxy.zap.view.table.AlertRiskTableCellItem
-
- All Implemented Interfaces:
java.lang.Comparable<AlertRiskTableCellItem>
public class AlertRiskTableCellItem extends java.lang.Object implements java.lang.Comparable<AlertRiskTableCellItem>
The representation of anAlert
's risk in a table cell, has the risk's name (displayed in the cell) and value (used for comparison).
-
-
Field Summary
Fields Modifier and Type Field Description static AlertRiskTableCellItem
NO_RISK_CELL_ITEM
Represents a nonAlert
's risk.static AlertRiskTableCellItem
UNDEFINED_RISK_CELL_ITEM
Represents an undefinedAlert
's risk.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(AlertRiskTableCellItem o)
boolean
equals(java.lang.Object object)
static AlertRiskTableCellItem
getItemForRisk(int risk)
Returns anAlertTableCellItem
for the givenrisk
.int
getRisk()
int
hashCode()
java.lang.String
toString()
-
-
-
Field Detail
-
NO_RISK_CELL_ITEM
public static final AlertRiskTableCellItem NO_RISK_CELL_ITEM
Represents a nonAlert
's risk. It has an empty name and value -1.Should be used when there's no alerts therefore no risk.
- See Also:
Alert.RISK_INFO
,Alert.RISK_LOW
,Alert.RISK_MEDIUM
,Alert.RISK_HIGH
-
UNDEFINED_RISK_CELL_ITEM
public static final AlertRiskTableCellItem UNDEFINED_RISK_CELL_ITEM
Represents an undefinedAlert
's risk. It has the name as undefined and value -2.- See Also:
Alert.RISK_INFO
,Alert.RISK_LOW
,Alert.RISK_MEDIUM
,Alert.RISK_HIGH
-
-
Method Detail
-
getRisk
public int getRisk()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
compareTo
public int compareTo(AlertRiskTableCellItem o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<AlertRiskTableCellItem>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getItemForRisk
public static AlertRiskTableCellItem getItemForRisk(int risk)
Returns anAlertTableCellItem
for the givenrisk
. If the risk is -1 the returnedAlertTableCellItem
will beNO_RISK_CELL_ITEM
.If the given
risk
is not -1 but it's not one of the risks defined anUNDEFINED_RISK_CELL_ITEM
will be returned.- Parameters:
risk
- the risk of the alert- Returns:
- the
AlertTableCellItem
for the givenrisk
. - See Also:
NO_RISK_CELL_ITEM
,UNDEFINED_RISK_CELL_ITEM
-
-