public String toString() { StringBuffer sb = new StringBuffer(); sb.append("name: ").append(this.getName()).append(", code: ").append(this.getCode()).append(", vendor: ").append(this.getVendorId()).append(", weak: ") .append(this.isWeak()).append(", grouped: ").append(this.isGrouped()).append(", type: ").append(this.getType()).append(", multiplicity: ") .append(this.getMultiplicityIndicator()); if (this.isGrouped()) { for (AvpRepresentation child : this.getChildren()) { String childStr = child.toString().replace("\n", "\n---"); sb.append("\n---" + childStr); } } return sb.toString(); }
@Override public String toString() { StringBuffer sb = new StringBuffer(); sb.append("name: ").append(this.getName()).append(", code: ").append(this.getCode()).append(", vendor: ").append(this.getVendorId()).append(", weak: ") .append(this.isWeak()).append(", grouped: ").append(this.isGrouped()).append(", type: ").append(this.getType()).append(", multiplicity: ") .append(this.getMultiplicityIndicator()); if (this.isGrouped()) { for (AvpRepresentation child : this.getChildren()) { String childStr = child.toString().replace("\n", "\n---"); sb.append("\n---" + childStr); } } return sb.toString(); }
public boolean isAllowed(int avpCode, long vendorId) { if (this.isGrouped()) { // make better get ? for (AvpRepresentation rep : this.children) { if (rep.getCode() == avpCode && rep.getVendorId() == vendorId) { return rep.isAllowed(); } else { continue; } } return true; } else { return false; } }
public boolean isAllowed(int avpCode, long vendorId) { if (this.isGrouped()) { // make better get ? for (AvpRepresentation rep : this.children) { if (rep.getCode() == avpCode && rep.getVendorId() == vendorId) { return rep.isAllowed(); } else { continue; } } return true; } else { return false; } }
AvpRepresentation(AvpRepresentationImpl clone) { this(-1, clone.getCode(), clone.getVendorId(), clone.getMultiplicityIndicator(), clone.getName()); this.allowed = clone.isAllowed(); this.grouped = clone.isGrouped(); this.positionIndex = clone.getPositionIndex(); this.weak = clone.isWeak(); this._mandatory = clone.isMandatory(); this._protected = clone.isProtected(); this.description = clone.getDescription(); this.mayEncrypt = clone.isMayEncrypt(); this.ruleMandatory = clone.getRuleMandatory(); this.ruleProtected = clone.getRuleProtected(); this.ruleVendorBit = clone.getRuleVendorBit(); this.type = clone.getType(); if (this.multiplicityIndicator.equals(_MP_NOT_ALLOWED)) this.allowed = false; // copy others. if (isGrouped()) { for (Object o : clone.getChildren()) { AvpRepresentationImpl avpImpl = (AvpRepresentationImpl) o; this.children.add(new AvpRepresentation(avpImpl)); } this.children = Collections.unmodifiableList(this.children); } }
AvpRepresentation(AvpRepresentationImpl clone) { this(-1, clone.getCode(), clone.getVendorId(), clone.getMultiplicityIndicator(), clone.getName()); this.allowed = clone.isAllowed(); this.grouped = clone.isGrouped(); this.positionIndex = clone.getPositionIndex(); this.weak = clone.isWeak(); this._mandatory = clone.isMandatory(); this._protected = clone.isProtected(); this.description = clone.getDescription(); this.mayEncrypt = clone.isMayEncrypt(); this.ruleMandatory = clone.getRuleMandatory(); this.ruleProtected = clone.getRuleProtected(); this.ruleVendorBit = clone.getRuleVendorBit(); this.type = clone.getType(); if (this.multiplicityIndicator.equals(_MP_NOT_ALLOWED)) { this.allowed = false; } // copy others. if (isGrouped()) { for (Object o : clone.getChildren()) { AvpRepresentationImpl avpImpl = (AvpRepresentationImpl) o; this.children.add(new AvpRepresentation(avpImpl)); } this.children = Collections.unmodifiableList(this.children); } }
AvpRepresentation avpRep = AvpDictionary.INSTANCE.getAvp(a.getCode(), a.getVendorId()); if(avpRep != null) { if(avpRep.isGrouped()) {
AvpRepresentation avpRep = AvpDictionary.INSTANCE.getAvp(a.getCode(), a.getVendorId()); if(avpRep != null) { if(avpRep.isGrouped()) {