public class MutableVarbindCollection extends Object implements VarbindCollection
VarbindCollection
.Constructor and Description |
---|
MutableVarbindCollection() |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
String key,
Varbind varbind) |
void |
addIndex(String key,
Varbind varbind) |
List<Varbind> |
asList()
Gets the contents of this collection as a immutable
List with
the same size and order as this collection. |
Map<String,Varbind> |
asMap()
Gets the contents of this collection as a immutable
Map indexed
using the same keys present in this collection. |
Varbind |
get(int index)
Gets a varbind from the collection.
|
Varbind |
get(String oid)
Gets a varbind from the collection.
|
VarbindCollection |
immutableCopy()
Creates an immutable copy of the receiver.
|
Iterator<Varbind> |
iterator() |
Set<String> |
keySet()
Gets the set of keys (MIB names and/or dotted-decimal object identifiers
for which a varbind exists in this collection).
|
List<String> |
nextIdentifiers(List<String> oids)
Creates a list of object identifiers for a GETNEXT or GETBULK operation.
|
List<String> |
nextIdentifiers(String... ids)
Creates a list of object identifiers for a GETNEXT or GETBULK operation.
|
int |
size()
Gets the number of varbinds in this collection.
|
String |
toString() |
public VarbindCollection immutableCopy()
public int size()
size
in interface VarbindCollection
public Set<String> keySet()
keySet
in interface VarbindCollection
public Varbind get(int index)
get
in interface VarbindCollection
index
- zero-based index of the varbind to retrievepublic Varbind get(String oid)
get
in interface VarbindCollection
oid
- MIB name or dotted-decimal object identifier of the object
to retrieve; the specified value must be equal to one of values
passed to the SNMP operation that resulted in this varbind collectionnull
if no varbind exists with the given
namepublic List<Varbind> asList()
List
with
the same size and order as this collection.asList
in interface VarbindCollection
public Map<String,Varbind> asMap()
Map
indexed
using the same keys present in this collection.asMap
in interface VarbindCollection
public List<String> nextIdentifiers(List<String> oids)
The resulting list is a concatenation of the specified oids
and
the object identifiers associated with the varbinds in this collection,
starting at index=oids.size()
. This method allows you to easily
construct a list of object identifiers where non-repeating objects
identifiers are specified in the given oids
and repeating object
identifiers are extracted from the previously retrieved varbinds.
nextIdentifiers
in interface VarbindCollection
oids
- array of object identifiers to prepend to the resulting listoids
followed by
the OIDS associated with the varbinds in this collection, starting
at start
.public List<String> nextIdentifiers(String... ids)
The resulting list is a concatenation of the specified oids
and
the object identifiers associated with the varbinds in this collection,
starting at index=oids.size()
. This method allows you to easily
construct a list of object identifiers where non-repeating objects
identifiers are specified in the given oids
and repeating object
identifiers are extracted from the previously retrieved varbinds.
nextIdentifiers
in interface VarbindCollection
ids
- array of object identifiers to prepend to the resulting listoids
followed by
the OIDS associated with the varbinds in this collection, starting
at start
.Copyright © 2012–2015. All rights reserved.