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 1998-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 public abstract class DhcptabRecord implements Serializable, Cloneable { 34 public static final String MACRO = "m"; 35 public static final String OPTION = "s"; 36 37 public static final String DEFAULT_SIGNATURE = "0"; 38 39 protected String key; 40 protected String flag; 41 protected String value; 42 protected String signature = DEFAULT_SIGNATURE; 43 44 // Serialization id for this class 45 static final long serialVersionUID = -1734667901914072052L; 46 47 public DhcptabRecord() { 48 key = flag = value = ""; 49 signature = DEFAULT_SIGNATURE; 50 } 51 52 public DhcptabRecord(String k, String f, String v) { 53 this(k, f, v, DEFAULT_SIGNATURE); 54 } 55 56 public DhcptabRecord(String k, String f, String v, String sig) { 57 key = k; 58 flag = f; 59 value = v; 60 signature = sig; 61 } 62 63 public void setKey(String k) throws ValidationException { 64 key = k; 65 } 66 67 public String getKey() { 68 return key; 69 } 70 71 public void setFlag(String f) throws ValidationException { 72 flag = f; 73 } 74 75 public String getFlag() { 76 return flag; 77 } 78 79 public void setValue(String v) throws ValidationException { 80 value = v; 81 } 82 83 public String getValue() { 84 return value; 85 } 86 87 public void setSignature(String sig) { 88 signature = sig; 89 } 90 91 public String getSignature() { 92 return signature; 93 } 94 95 public String toString() { 96 return new String(key + " " + flag + " " + signature + " " + value); 97 } 98 }