View Javadoc

1   /*
2    * Copyright 2007-2011 smartics, Kronseder & Reiner GmbH
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package de.smartics.exceptions.code;
17  
18  import de.smartics.exceptions.core.Code;
19  
20  /**
21   * A specific code interface that deals with number codes. Implementations of
22   * this interface provide access to a major and a minor number.
23   *
24   * @author <a href="mailto:robert.reiner@smartics.de">Robert Reiner</a>
25   * @version $Revision:591 $
26   */
27  public interface NumberCode extends Code
28  {
29    // ********************************* Fields *********************************
30  
31    // --- constants ------------------------------------------------------------
32  
33    // ****************************** Initializer *******************************
34  
35    // ****************************** Inner Classes *****************************
36  
37    // ********************************* Methods ********************************
38  
39    // --- get&set --------------------------------------------------------------
40  
41    // --- business -------------------------------------------------------------
42  
43    /**
44     * Returns the major number of the code defines a group of codes. This group
45     * is associated with a certain type of problem within the component.
46     * <p>
47     * For example HTTP knows the major numbers 100, 200, 300, 400, etc.
48     *
49     * @return the major number of the code defines a group of codes.
50     */
51    Integer getMajorNumber();
52  
53    /**
54     * Returns the minor number gives additional information about the problem. It
55     * specifies exactly the type of problem. If this value is <code>null</code>,
56     * there is no minor number specified.
57     * <p>
58     * For example HTTP knows the minor number 4 for page not found. This will add
59     * with the major number to 404.
60     *
61     * @return the minor number gives additional information about the problem.
62     */
63    Integer getMinorNumber();
64  
65    // --- object basics --------------------------------------------------------
66  }