1 /*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * ident "%Z%%M% %I% %E% SMI"
24 *
25 * Copyright 2001-2002 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 package com.sun.dhcpmgr.data;
30
31 import java.io.Serializable;
32
33 /**
34 * OptionContext simply defines the attributes that should be associated
35 * with an Option context. Simply a container.
36 */
37 public class OptionContext implements Serializable {
38
39 private byte code;
40 private String dhcptabString;
41 private String string;
42
43 // Serialization id for this class
44 static final long serialVersionUID = -8656392905082090762L;
45
46 /**
47 * Constructs a fully defined instance of an OptionContext.
48 * @param code the context code
49 * @param dhcptabString the dhcptab string definition for the context
50 * @param msgid the msgid for the description of the context
51 */
52 public OptionContext(byte code, String dhcptabString, String msgid) {
53 this.code = code;
54 this.dhcptabString = dhcptabString;
55 this.string = ResourceStrings.getString(msgid);
56 } // constructor
57
58 /**
59 * Returns the code for the context
60 * @returns the code for the context
61 */
62 public byte getCode() {
63 return code;
64 } // getCode
65
66 /**
67 * Returns the dhcptab string definition for the context
68 * @returns the dhcptab string definition for the context
69 */
70 public String getDhcptabString() {
71 return dhcptabString;
72 } // getDhcptabString
73
74 /**
75 * Returns a string representation of this object.
76 * @return a string representation of this object.
77 */
78 public String toString() {
79 return (string);
80 } // toString
81
82 } // OptionContext