Serializable
, Cloneable
, ChangeSet<SnmpValueChange>
public class SnmpValueChange extends org.snmp4j.smi.VariableBinding implements ChangeSet<SnmpValueChange>
SnmpValueChange
class represents a single value change with old a new value
supporting undo and redo operations.ChangeSet.ChangeStatus
Constructor | Description |
---|---|
SnmpValueChange(org.snmp4j.smi.OID oid,
Class valueClass,
Object newValue,
Object oldValue) |
Creates a value change with SNMP instance OID, model value class, old, and new value.
|
Modifier and Type | Method | Description |
---|---|---|
List<SnmpValueChange> |
getChanges() |
Gets a list of the changes objects.
|
ChangeSet.ChangeStatus |
getChangeStatus() |
Gets the status of the change as defined by
ChangeSet.ChangeStatus . |
SnmpErrorStatus |
getErrorStatus() |
Gets the SNMP error status for this change.
|
Object |
getNewValue() |
Gets the new value.
|
Object |
getOldValue() |
Gets the old value.
|
ChangeSet.ChangeStatus |
getStatus() |
The status of the change.
|
Class |
getValueClass() |
Gets the class of the model values.
|
void |
setErrorStatus(SnmpErrorStatus errorStatus) |
Sets the SNMP error status for this change.
|
void |
setNewValue(Object newValue) |
Sets the new value.
|
void |
setOldValue(Object oldValue) |
Sets the old value.
|
void |
setStatus(ChangeSet.ChangeStatus status) |
Sets the status of the change.
|
String |
toString() |
public SnmpValueChange(org.snmp4j.smi.OID oid, Class valueClass, Object newValue, Object oldValue)
oid
- the instance OID of the target SNMP object instance (i.e., for scalars including the .0
suffix).valueClass
- the value class of the model values.newValue
- the new model value.oldValue
- the old model value (or null
if it did not exist).public Class getValueClass()
public ChangeSet.ChangeStatus getChangeStatus()
ChangeSet.ChangeStatus
.public Object getNewValue()
public void setNewValue(Object newValue)
newValue
- the new value (the value class must be compatible with the getValueClass()
otherwise the
mapping to the SNMP value and vice versa will fail (later).public Object getOldValue()
public void setOldValue(Object oldValue)
oldValue
- the old value (the value class must be compatible with the getValueClass()
otherwise the
mapping to the SNMP value and vice versa will fail (later).public List<SnmpValueChange> getChanges()
ChangeSet
getChanges
in interface ChangeSet<SnmpValueChange>
public ChangeSet.ChangeStatus getStatus()
ChangeSet
getStatus
in interface ChangeSet<SnmpValueChange>
public void setStatus(ChangeSet.ChangeStatus status)
ChangeSet
setStatus
in interface ChangeSet<SnmpValueChange>
status
- the new status.public SnmpErrorStatus getErrorStatus()
getErrorStatus
in interface ChangeSet<SnmpValueChange>
SnmpErrorStatus
.public void setErrorStatus(SnmpErrorStatus errorStatus)
errorStatus
- the new SNMP error status as defined by SnmpErrorStatus
.public String toString()
toString
in class org.snmp4j.smi.VariableBinding
Copyright © 2020 SNMP4J.org. All rights reserved.