@Test public void parseTest() { if (expectedException != null) { thrown.expect(expectedException); } BlobRef ref = BlobRefTypeHandler.parsePersistableFormat(blobRef); assertThat(ref.getStore(), equalTo(expectedStore)); assertThat(ref.getBlob(), equalTo(expectedBlob)); assertThat(ref.getNode(), equalTo(expectedNode)); }
public static BlobRef parsePersistableFormat(final String spec) { int colon = spec.indexOf(':'); int at = spec.lastIndexOf('@'); if (colon > 0 && at > 0 && at-1 > colon && at < spec.length()-1) { return new BlobRef(spec.substring(at+1), spec.substring(0, colon), spec.substring(colon+1, at)); } else { throw new IllegalArgumentException("Not a valid blob reference: " + spec); } }
BlobRefTypeHandler extends BaseTypeHandler<BlobRef> implements ContentTypeHandler<BlobRef> { public static BlobRef parsePersistableFormat(final String spec) { int colon = spec.indexOf(':'); int at = spec.lastIndexOf('@'); if (colon > 0 && at > 0 && at-1 > colon && at < spec.length()-1) { return new BlobRef(spec.substring(at+1), spec.substring(0, colon), spec.substring(colon+1, at)); } else { throw new IllegalArgumentException("Not a valid blob reference: " + spec); } } }
BlobRefTypeHandler extends BaseTypeHandler<BlobRef> implements ContentTypeHandler<BlobRef> { public static BlobRef parsePersistableFormat(final String spec) { int colon = spec.indexOf(':'); int at = spec.lastIndexOf('@'); if (colon > 0 && at > 0 && at-1 > colon && at < spec.length()-1) { return new BlobRef(spec.substring(at+1), spec.substring(0, colon), spec.substring(colon+1, at)); } else { throw new IllegalArgumentException("Not a valid blob reference: " + spec); } }  }
BlobRefTypeHandler extends BaseTypeHandler<BlobRef> implements ContentTypeHandler<BlobRef> { public static BlobRef parsePersistableFormat(final String spec) { int colon = spec.indexOf(':'); int at = spec.lastIndexOf('@'); if (colon > 0 && at > 0 && at-1 > colon && at < spec.length()-1) { return new BlobRef(spec.substring(at+1), spec.substring(0, colon), spec.substring(colon+1, at)); } else { throw new IllegalArgumentException("Not a valid blob reference: " + spec); } }  @Override void setNonNullParameter(final PreparedStatement ps,
                                  final int parameterIndex,
                                  final BlobRef parameter,
                                  final JdbcType jdbcType); @Override BlobRef getNullableResult(final ResultSet rs, final String columnName); @Override BlobRef getNullableResult(final ResultSet rs, final int columnIndex); @Override BlobRef getNullableResult(final CallableStatement cs, final int columnIndex); String toPersistableString(final BlobRef blobRef); static BlobRef parsePersistableFormat(final String spec); }
BlobRefTypeHandler extends BaseTypeHandler<BlobRef> implements ContentTypeHandler<BlobRef> { public static BlobRef parsePersistableFormat(final String spec) { int colon = spec.indexOf(':'); int at = spec.lastIndexOf('@'); if (colon > 0 && at > 0 && at-1 > colon && at < spec.length()-1) { return new BlobRef(spec.substring(at+1), spec.substring(0, colon), spec.substring(colon+1, at)); } else { throw new IllegalArgumentException("Not a valid blob reference: " + spec); } }  @Override void setNonNullParameter(final PreparedStatement ps,
                                  final int parameterIndex,
                                  final BlobRef parameter,
                                  final JdbcType jdbcType); @Override BlobRef getNullableResult(final ResultSet rs, final String columnName); @Override BlobRef getNullableResult(final ResultSet rs, final int columnIndex); @Override BlobRef getNullableResult(final CallableStatement cs, final int columnIndex); String toPersistableString(final BlobRef blobRef); static BlobRef parsePersistableFormat(final String spec);  }