/** * Constructs a new PDU from a type and a list of {@link VariableBinding} instances. * The list will not be referenced, instead a deep copy of the variable bindings * is executed (each variable binding will be cloned). * * @param pduType the PDU type. * @param vbs the variable bindings. * @since 2.2.4 */ public PDU(int pduType, List<? extends VariableBinding> vbs) { this.type = pduType; variableBindings = new ArrayList<>(vbs.size()); for (VariableBinding vb : vbs) { variableBindings.add((VariableBinding) vb.clone()); } }
/** * Constructs a new PDU from a type and a list of {@link VariableBinding} instances. * The list will not be referenced, instead a deep copy of the variable bindings * is executed (each variable binding will be cloned). * * @param pduType * the PDU type. * @param vbs * the variable bindings. * @since 2.2.4 */ public PDU(int pduType, List<? extends VariableBinding> vbs) { this.type = pduType; variableBindings = new Vector<VariableBinding>(vbs.size()); for (VariableBinding vb : vbs) { variableBindings.add((VariableBinding) vb.clone()); } }
/** * Copy constructor which creates a deep copy (clone) of the * other PDU. * @param other * the {@code PDU} to copy from. */ public PDU(PDU other) { variableBindings = new Vector<VariableBinding>(other.size()); for (VariableBinding vb : other.variableBindings) { variableBindings.add((VariableBinding) vb.clone()); } errorIndex = (Integer32) other.errorIndex.clone(); errorStatus = (Integer32) other.errorStatus.clone(); type = other.type; if (other.requestID != null) { requestID = (Integer32) other.requestID.clone(); } }
/** * Copy constructor which creates a deep copy (clone) of the * other PDU. * * @param other the {@code PDU} to copy from. */ public PDU(PDU other) { variableBindings = new ArrayList<>(other.size()); for (VariableBinding vb : other.variableBindings) { variableBindings.add((VariableBinding) vb.clone()); } errorIndex = (Integer32) other.errorIndex.clone(); errorStatus = (Integer32) other.errorStatus.clone(); type = other.type; if (other.requestID != null) { requestID = (Integer32) other.requestID.clone(); } }
request.clear(); for (int i=Math.max(0,lastRowIndex); i<lastRowIndex + rootOIDs.length; i++) { VariableBinding next = (VariableBinding) respPDU.get(i).clone(); next.setVariable(new Null()); request.add(next);
request.clear(); for (int i=Math.max(0,lastRowIndex); i<lastRowIndex + rootOIDs.length; i++) { VariableBinding next = (VariableBinding) respPDU.get(i).clone(); next.setVariable(new Null()); request.add(next);
if (listener.next(new TreeEvent(this, userObject, vbs))) { VariableBinding next = (VariableBinding) respPDU.get(respPDU.size() - 1).clone(); next.setVariable(new Null()); request.set(0, next);