public class

SnmpString

extends SnmpValue
java.lang.Object
   ↳ com.sun.jmx.snmp.SnmpValue
     ↳ com.sun.jmx.snmp.SnmpString
Known Direct Subclasses

Class Overview

Represents an SNMP string.

This API is a Sun Microsystems internal API and is subject to change without notice.

Summary

[Expand]
Inherited Constants
From interface com.sun.jmx.snmp.SnmpDataTypeEnums
Fields
protected byte[] value This is the bytes array of the string value.
Public Constructors
SnmpString()
Constructs a new empty SnmpString.
SnmpString(byte[] v)
Constructs a new SnmpString from the specified bytes array.
SnmpString(Byte[] v)
Constructs a new SnmpString from the specified Bytes array.
SnmpString(String v)
Constructs a new SnmpString from the specified String value.
SnmpString(InetAddress address)
Constructs a new SnmpString from the specified InetAddress .
Public Methods
static String BinToChar(String bin)
Converts the specified binary string into a character string.
static String HexToChar(String hex)
Converts the specified hexadecimal string into a character string.
static void appendToOid(SnmpOid source, SnmpOid dest)
Appends an SnmpOid representing an SnmpString to another OID.
byte[] byteValue()
Returns the bytes array of this SnmpString.
synchronized Object clone()
Clones the SnmpString object, making a copy of its data.
synchronized final SnmpValue duplicate()
Performs a clone action.
String getTypeName()
Returns a textual description of the type object.
InetAddress inetAddressValue()
Converts the string value to its InetAddress form.
static int nextOid(long[] index, int start)
Scans an index OID, skips the string value and returns the position of the next value.
Byte[] toByte()
Converts the string value to its array of Bytes form.
SnmpOid toOid()
Converts the string value to its SnmpOid form.
static SnmpOid toOid(long[] index, int start)
Extracts the string from an index OID and returns its value converted as an SnmpOid.
String toString()
Converts the string value to its String form.
[Expand]
Inherited Methods
From class com.sun.jmx.snmp.SnmpValue
From class java.lang.Object

Fields

protected byte[] value

This is the bytes array of the string value.

Public Constructors

public SnmpString ()

Constructs a new empty SnmpString.

public SnmpString (byte[] v)

Constructs a new SnmpString from the specified bytes array.

Parameters
v The bytes composing the string value.

public SnmpString (Byte[] v)

Constructs a new SnmpString from the specified Bytes array.

Parameters
v The Bytes composing the string value.

public SnmpString (String v)

Constructs a new SnmpString from the specified String value.

Parameters
v The initialization value.

public SnmpString (InetAddress address)

Constructs a new SnmpString from the specified InetAddress .

Parameters
address The InetAddress .

Public Methods

public static String BinToChar (String bin)

Converts the specified binary string into a character string.

Parameters
bin The binary string value to convert.
Returns
  • The character string representation.

public static String HexToChar (String hex)

Converts the specified hexadecimal string into a character string.

Parameters
hex The hexadecimal string value to convert.
Returns
  • The character string representation.

public static void appendToOid (SnmpOid source, SnmpOid dest)

Appends an SnmpOid representing an SnmpString to another OID.

Parameters
source An OID representing an SnmpString value.
dest Where source should be appended.

public byte[] byteValue ()

Returns the bytes array of this SnmpString.

Returns
  • The value.

public synchronized Object clone ()

Clones the SnmpString object, making a copy of its data.

Returns
  • The object clone.

public final synchronized SnmpValue duplicate ()

Performs a clone action. This provides a workaround for the SnmpValue interface.

Returns
  • The SnmpValue clone.

public String getTypeName ()

Returns a textual description of the type object.

Returns
  • ASN.1 textual description.

public InetAddress inetAddressValue ()

Converts the string value to its InetAddress form.

Returns
Throws
UnknownHostException If string value is not a legal address format.

public static int nextOid (long[] index, int start)

Scans an index OID, skips the string value and returns the position of the next value.

Parameters
index The index array.
start The position in the index array.
Returns
  • The position of the next value.
Throws
SnmpStatusException There is no string value available at the start position.

public Byte[] toByte ()

Converts the string value to its array of Bytes form.

Returns
  • The array of Bytes representation of the value.

public SnmpOid toOid ()

Converts the string value to its SnmpOid form.

Returns
  • The OID representation of the value.

public static SnmpOid toOid (long[] index, int start)

Extracts the string from an index OID and returns its value converted as an SnmpOid.

Parameters
index The index array.
start The position in the index array.
Returns
  • The OID representing the string value.
Throws
SnmpStatusException There is no string value available at the start position.

public String toString ()

Converts the string value to its String form.

Returns
  • The String representation of the value.