public ByteData createValue() { return new DestinationAddress(); }
public Address getAddress() { if (isAddress()) { return (Address) theAddress; } else { return null; } }
public DistributionList getDistributionList() { if (isDistributionList()) { return (DistributionList) theAddress; } else { return null; } }
public ByteBuffer getData() throws ValueNotSetException { if (hasValue()) { ByteBuffer buffer = new ByteBuffer(); buffer.appendByte(getDestFlag()); if (isAddress()) { Address address = getAddress(); buffer.appendBuffer(address.getData()); } else if (isDistributionList()) { DistributionList dl = getDistributionList(); buffer.appendBuffer(dl.getData()); } return buffer; } else { throw new ValueNotSetException(); } }
public String debugString() { String dbgs = "(destaddr: "; dbgs += super.debugString(); dbgs += Integer.toString(getDestFlag()); dbgs += " "; dbgs += getTheAddress().debugString(); dbgs += ") "; return dbgs; } }
public void setData(ByteBuffer buffer) throws NotEnoughDataInByteBufferException, TerminatingZeroNotFoundException, WrongLengthOfStringException, WrongDestFlagException { destFlag = buffer.removeByte(); switch (destFlag) { case Data.SM_DEST_SME_ADDRESS : { Address address = new Address(); address.setData(buffer); setAddress(address); break; } case Data.SM_DEST_DL_NAME : { DistributionList dl = new DistributionList(); dl.setData(buffer); setDistributionList(dl); break; } default : { throw new WrongDestFlagException("" + destFlag); } } }
public DestinationAddress(Address address) { setAddress(address); }
public DestinationAddress(DistributionList dl) { setDistributionList(dl); }
public DestinationAddress(String address) throws WrongLengthOfStringException { setAddress(new Address(address)); }
numberOfDestination = getParam("Number of destinations", numberOfDestination); for (int i = 0; i < numberOfDestination; i++) { request.addDestAddress(new DestinationAddress(getAddress("Destination", destAddress)));
public DestinationAddress(byte ton, byte npi, String address) throws WrongLengthOfStringException { setAddress(new Address(ton, npi, address)); }