@Test public void testCanParse() { String sdp1 = "a=fingerprint:sha-256 D1:2C:BE:AD:C4:F6:64:5C:25:16:11:9C:AF:E7:0F:73:79:36:4E:9C:1E:15:54:39:0C:06:8B:ED:96:86:00:39\n\r"; String sdp2 = "x=fingerprint:sha-256 D1:2C:BE:AD:C4:F6:64:5C:25:16:11:9C:AF:E7:0F:73:79:36:4E:9C:1E:15:54:39:0C:06:8B:ED:96:86:00:39\n\r"; String sdp3 = "a=finger:sha-256 D1:2C:BE:AD:C4:F6:64:5C:25:16:11:9C:AF:E7:0F:73:79:36:4E:9C:1E:15:54:39:0C:06:8B:ED:96:86:00:39\n\r"; String sdp4 = "a=fingerprint:D1:2C:BE:AD:C4:F6:64:5C:25:16:11:9C:AF:E7:0F:73:79:36:4E:9C:1E:15:54:39:0C:06:8B:ED:96:86:00:39\n\r"; String sdp5 = "a=fingerprint:sha-256 D1:2C:BE:AD:C4:F6:64:5C:25:16:11:9C:AF:E7:0F:73:79:36:4E:9C:1E:15:54:39:0C:06:8B:ED:96:86:00:39:\n\r"; String sdp6 = "a=fingerprint:sha-256 D1:2C:BE: AD:C4:F6:64:5C:25:16:11:9C:AF:E7:0F:73:79:36:4E:9C:1E:15:54:39:0C:06:8B:ED:96:86:00:39:\n\r"; String sdp7 = "a=fingerprint:sha-256\n\r"; boolean canParseSdp1 = parser.canParse(sdp1); boolean canParseSdp2 = parser.canParse(sdp2); boolean canParseSdp3 = parser.canParse(sdp3); boolean canParseSdp4 = parser.canParse(sdp4); boolean canParseSdp5 = parser.canParse(sdp5); boolean canParseSdp6 = parser.canParse(sdp6); boolean canParseSdp7 = parser.canParse(sdp7); Assert.assertTrue(canParseSdp1); Assert.assertFalse(canParseSdp2); Assert.assertFalse(canParseSdp3); Assert.assertFalse(canParseSdp4); Assert.assertFalse(canParseSdp5); Assert.assertFalse(canParseSdp6); Assert.assertFalse(canParseSdp7); }
@Override public boolean canParse(String sdp) { if(sdp == null || sdp.isEmpty()) { return false; } return PATTERN.matcher(sdp.trim()).matches(); }
FingerprintAttributeParser implements SdpParser<FingerprintAttribute> { @Override public boolean canParse(String sdp) { if(sdp == null || sdp.isEmpty()) { return false; } return PATTERN.matcher(sdp.trim()).matches(); } }
FingerprintAttributeParser implements SdpParser<FingerprintAttribute> { @Override public boolean canParse(String sdp) { if(sdp == null || sdp.isEmpty()) { return false; } return PATTERN.matcher(sdp.trim()).matches(); }  }
FingerprintAttributeParser implements SdpParser<FingerprintAttribute> { @Override public boolean canParse(String sdp) { if(sdp == null || sdp.isEmpty()) { return false; } return PATTERN.matcher(sdp.trim()).matches(); }  @Override boolean canParse(String sdp); @Override FingerprintAttribute parse(String sdp); @Override void parse(FingerprintAttribute field, String sdp); }
FingerprintAttributeParser implements SdpParser<FingerprintAttribute> { @Override public boolean canParse(String sdp) { if(sdp == null || sdp.isEmpty()) { return false; } return PATTERN.matcher(sdp.trim()).matches(); }  @Override boolean canParse(String sdp); @Override FingerprintAttribute parse(String sdp); @Override void parse(FingerprintAttribute field, String sdp);  }