@Test public void testParse() throws SdpException { String sdp1 = "a=ptime:100\n\r"; PacketTimeAttribute obj = parser.parse(sdp1); Assert.assertEquals("ptime", obj.getKey()); Assert.assertEquals(100, obj.getTime()); Assert.assertEquals(sdp1.trim(), obj.toString()); }
@Override public PacketTimeAttribute parse(String sdp) throws SdpException { try { int separator = sdp.indexOf(AttributeField.ATTRIBUTE_SEPARATOR); if(separator == -1) { throw new IllegalArgumentException("No value found"); } int value = Integer.parseInt(sdp.trim().substring(separator + 1)); return new PacketTimeAttribute(value); } catch (Exception e) { throw new SdpException(PARSE_ERROR + sdp, e); } }
PacketTimeAttributeParser implements SdpParser<PacketTimeAttribute> { @Override public PacketTimeAttribute parse(String sdp) throws SdpException { try { int separator = sdp.indexOf(AttributeField.ATTRIBUTE_SEPARATOR); if(separator == -1) { throw new IllegalArgumentException("No value found"); } int value = Integer.parseInt(sdp.trim().substring(separator + 1)); return new PacketTimeAttribute(value); } catch (Exception e) { throw new SdpException(PARSE_ERROR + sdp, e); } } }
PacketTimeAttributeParser implements SdpParser<PacketTimeAttribute> { @Override public PacketTimeAttribute parse(String sdp) throws SdpException { try { int separator = sdp.indexOf(AttributeField.ATTRIBUTE_SEPARATOR); if(separator == -1) { throw new IllegalArgumentException("No value found"); } int value = Integer.parseInt(sdp.trim().substring(separator + 1)); return new PacketTimeAttribute(value); } catch (Exception e) { throw new SdpException(PARSE_ERROR + sdp, e); } }  }
PacketTimeAttributeParser implements SdpParser<PacketTimeAttribute> { @Override public PacketTimeAttribute parse(String sdp) throws SdpException { try { int separator = sdp.indexOf(AttributeField.ATTRIBUTE_SEPARATOR); if(separator == -1) { throw new IllegalArgumentException("No value found"); } int value = Integer.parseInt(sdp.trim().substring(separator + 1)); return new PacketTimeAttribute(value); } catch (Exception e) { throw new SdpException(PARSE_ERROR + sdp, e); } }  @Override boolean canParse(String sdp); @Override PacketTimeAttribute parse(String sdp); @Override void parse(PacketTimeAttribute field, String sdp); }
PacketTimeAttributeParser implements SdpParser<PacketTimeAttribute> { @Override public PacketTimeAttribute parse(String sdp) throws SdpException { try { int separator = sdp.indexOf(AttributeField.ATTRIBUTE_SEPARATOR); if(separator == -1) { throw new IllegalArgumentException("No value found"); } int value = Integer.parseInt(sdp.trim().substring(separator + 1)); return new PacketTimeAttribute(value); } catch (Exception e) { throw new SdpException(PARSE_ERROR + sdp, e); } }  @Override boolean canParse(String sdp); @Override PacketTimeAttribute parse(String sdp); @Override void parse(PacketTimeAttribute field, String sdp);  }