|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.exceptions.code.NumberCodeInfo
public class NumberCodeInfo
This Code
implementation models the exception code as a number. It supports a component identifier as an arbitrary string and provides a facility to specify the number as a major an minor number that will be added.
Field Summary | |
---|---|
protected String |
componentId The identifier of the component this code belongs to. |
protected Integer |
majorNumber The major number of the code defines a group of codes. |
protected Integer |
minorNumber The minor number gives additional information about the problem. |
Constructor Summary | |
---|---|
NumberCodeInfo(Integer majorNumber) Convenience constructor. |
|
NumberCodeInfo(String componentId, Integer majorNumber) Convenience constructor. |
|
NumberCodeInfo(String componentId, Integer majorNumber, Integer minorNumber) Default constructor. |
Method Summary | |
---|---|
String |
getCode() Returns the string representation of the code. |
String |
getComponentId() Returns the identifier of the component this code belongs to. |
String |
getDisplayId() Returns the string representation of the code. |
Integer |
getMajorNumber() Returns the major number of the code defines a group of codes. |
Integer |
getMinorNumber() Returns the minor number gives additional information about the problem. |
String |
toString() Returns the string representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final String componentId
protected final Integer majorNumber
For example HTTP knows the major numbers 100, 200, 300, 400, etc.
protected final Integer minorNumber
null
, there is no minor number specified.
For example HTTP knows the minor number 4 for page not found. This will add with the major number to 404.
Constructor Detail |
---|
public NumberCodeInfo(Integer majorNumber)
majorNumber
- the major number of the code defines a group of codes.
public NumberCodeInfo(String componentId, Integer majorNumber)
componentId
- the identifier of the component this code belongs to.
majorNumber
- the major number of the code defines a group of codes.
public NumberCodeInfo(String componentId, Integer majorNumber, Integer minorNumber) throws NullPointerException
componentId
- the identifier of the component this code belongs to.
majorNumber
- the major number of the code defines a group of codes.
minorNumber
- the minor number gives additional information about the problem.
NullPointerException
- if the major number is
null
.
Method Detail |
---|
public String getComponentId()
getComponentId
in interface
Code
public Integer getMajorNumber()
NumberCode
For example HTTP knows the major numbers 100, 200, 300, 400, etc.
getMajorNumber
in interface
NumberCode
public Integer getMinorNumber()
NumberCode
null
, there is no minor number specified.
For example HTTP knows the minor number 4 for page not found. This will add with the major number to 404.
getMinorNumber
in interface
NumberCode
public String getDisplayId()
Code
This returns the same value as Code.toString()
as this method can be used via property getter.
getDisplayId
in interface
Code
public String getCode()
Code
This is the code within the component and lacks the component identifier. If the component is interested in the code, this identifier is used.
getCode
in interface
Code
public String toString()
toString
in interface
Code
toString
in class
Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |