de.smartics.exceptions.code
Class TwoNumberCodeInfo

Package class diagram package TwoNumberCodeInfo
java.lang.Object
  extended by de.smartics.exceptions.code.NumberCodeInfo
      extended by de.smartics.exceptions.code.TwoNumberCodeInfo
All Implemented Interfaces:
NumberCode, Code, Serializable

public class TwoNumberCodeInfo
     
     
extends 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 and a minor number that will be displayed separately.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class de.smartics.exceptions.code.NumberCodeInfo
componentId, majorNumber, minorNumber
 
Constructor Summary
TwoNumberCodeInfo(Integer majorNumber)
          Convenience constructor.
TwoNumberCodeInfo(String componentId, Integer majorNumber)
          Convenience constructor.
TwoNumberCodeInfo(String componentId, Integer majorNumber, Integer minorNumber)
          Default constructor.
 
Method Summary
 String getCode()
          Returns the string representation of the code.
 String getDisplayId()
          Returns the string representation of the code.
 
Methods inherited from class de.smartics.exceptions.code.NumberCodeInfo
getComponentId, getMajorNumber, getMinorNumber, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TwoNumberCodeInfo

public TwoNumberCodeInfo(Integer majorNumber)
Convenience constructor.

Parameters:
majorNumber - the major number of the code defines a group of codes.

TwoNumberCodeInfo

public TwoNumberCodeInfo(String componentId,
                         Integer majorNumber)
Convenience constructor.

Parameters:
componentId - the identifier of the component this code belongs to.
majorNumber - the major number of the code defines a group of codes.

TwoNumberCodeInfo

public TwoNumberCodeInfo(String componentId,
                         Integer majorNumber,
                         Integer minorNumber)
                  throws NullPointerException
Default constructor.

Parameters:
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.
Throws:
NullPointerException - if the major number is null.
Method Detail

getCode

public String getCode()
Description copied from interface: Code
Returns the string representation of the 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.

Specified by:
getCode in interface Code
Overrides:
getCode in class NumberCodeInfo
Returns:
the string representation of the code.

getDisplayId

public String getDisplayId()
Description copied from interface: Code
Returns the string representation of the code. This includes the component identifier and the code. If the code is presented (e.g. in a log file) the return value of this method is used.

This returns the same value as Code.toString() as this method can be used via property getter.

Specified by:
getDisplayId in interface Code
Overrides:
getDisplayId in class NumberCodeInfo
Returns:
the string representation of the code.


Copyright © 2007-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.