View Javadoc

1   /*
2    * Copyright 2007-2013 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  public interface NumberCode extends Code
25  {
26    // ********************************* Fields *********************************
27  
28    // --- constants ------------------------------------------------------------
29  
30    // ****************************** Initializer *******************************
31  
32    // ****************************** Inner Classes *****************************
33  
34    // ********************************* Methods ********************************
35  
36    // --- get&set --------------------------------------------------------------
37  
38    // --- business -------------------------------------------------------------
39  
40    /**
41     * Returns the major number of the code defines a group of codes. This group
42     * is associated with a certain type of problem within the component.
43     * <p>
44     * For example HTTP knows the major numbers 100, 200, 300, 400, etc.
45     *
46     * @return the major number of the code defines a group of codes.
47     */
48    Integer getMajorNumber();
49  
50    /**
51     * Returns the minor number gives additional information about the problem. It
52     * specifies exactly the type of problem. If this value is <code>null</code>,
53     * there is no minor number specified.
54     * <p>
55     * For example HTTP knows the minor number 4 for page not found. This will add
56     * with the major number to 404.
57     *
58     * @return the minor number gives additional information about the problem.
59     */
60    Integer getMinorNumber();
61  
62    // --- object basics --------------------------------------------------------
63  }