1 29 30 31 package snmp; 32 33 34 37 38 public class SNMPNull extends SNMPObject 39 { 40 41 protected byte tag = SNMPBERCodec.SNMPNULL; 42 43 44 47 48 public Object getValue() 49 { 50 return null; 51 } 52 53 54 55 58 59 public void setValue(Object o) 60 throws SNMPBadValueException 61 { 62 throw new SNMPBadValueException(" Null: attempt to set value "); 63 } 64 65 66 67 70 71 protected byte[] getBEREncoding() 72 { 73 byte[] encoding = new byte[2]; 74 75 encoding[0] = SNMPBERCodec.SNMPNULL; 77 78 encoding[1] = 0; 80 81 83 return encoding; 84 } 85 86 87 88 91 92 public boolean equals(Object other) 93 { 94 if (other == null) 96 { 97 return false; 98 } 99 100 if (this.getClass().equals(other.getClass())) 102 { 103 return true; 104 } 105 else 106 { 107 return false; 108 } 109 } 110 111 112 113 116 117 public String toString() 118 { 119 return new String ("Null"); 120 } 121 122 } | Popular Tags |