01: /*
02: * $Id: ResultCode.java,v 1.29 2007/09/18 08:45:06 agoubard Exp $
03: *
04: * Copyright 2003-2007 Orange Nederland Breedband B.V.
05: * See the COPYRIGHT file for redistribution and use restrictions.
06: */
07: package org.xins.server;
08:
09: import org.xins.common.MandatoryArgumentChecker;
10:
11: /**
12: * Abstraction of an error code returned by a function. Result codes are
13: * either generic or API-specific.
14: *
15: * <p>Result codes do not automatically apply to all functions of an API if
16: * they have been defined for that API. Instead they are associated with each
17: * individual function.
18: *
19: * @version $Revision: 1.29 $ $Date: 2007/09/18 08:45:06 $
20: * @author <a href="mailto:ernst@ernstdehaan.com">Ernst de Haan</a>
21: * @author <a href="mailto:anthony.goubard@japplis.com">Anthony Goubard</a>
22: *
23: * @since XINS 1.0.0
24: */
25: public final class ResultCode {
26:
27: /**
28: * The symbolic name of this result code. Can be <code>null</code>.
29: */
30: private final String _name;
31:
32: /**
33: * Constructs a new generic <code>ResultCode</code>.
34: *
35: * @param name
36: * the symbolic name, can be <code>null</code>.
37: *
38: * @throws IllegalArgumentException
39: * if <code>name == null</code>.
40: */
41: public ResultCode(String name) throws IllegalArgumentException {
42: MandatoryArgumentChecker.check("name", name);
43: _name = name;
44: }
45:
46: /**
47: * Returns the symbolic name of this result code.
48: *
49: * @return
50: * the symbolic name, can be <code>null</code>.
51: */
52: public final String getName() {
53: return _name;
54: }
55: }
|