@Test public void test_deserialize() { assertThat(codec.deserialize(EOF, String.class), is(equalTo(""))); assertThat(codec.deserialize(" " + EOF, String.class), is(equalTo(" "))); assertThat(codec.deserialize("foo" + EOF, String.class), is(equalTo("foo"))); }
@Override public <T> T deserialize(String encoded, Class<T> target) throws DiagnosticCodecException { requireNonNull(encoded); requireNonNull(target); if (!target.isAssignableFrom(String.class)) { throw new IllegalArgumentException("Target type must be assignable from String"); } if (!encoded.endsWith(EOF)) { throw new DiagnosticCodecException("Unsupported encoded input"); } return target.cast(encoded.substring(0, encoded.length() - 3)); }
EmptyParameterDiagnosticCodec extends DiagnosticCodecSkeleton<String> { @Override public <T> T deserialize(String encoded, Class<T> target) throws DiagnosticCodecException { requireNonNull(encoded); requireNonNull(target); if (!target.isAssignableFrom(String.class)) { throw new IllegalArgumentException("Target type must be assignable from String"); } if (!encoded.endsWith(EOF)) { throw new DiagnosticCodecException("Unsupported encoded input"); } return target.cast(encoded.substring(0, encoded.length() - 3)); } }
EmptyParameterDiagnosticCodec extends DiagnosticCodecSkeleton<String> { @Override public <T> T deserialize(String encoded, Class<T> target) throws DiagnosticCodecException { requireNonNull(encoded); requireNonNull(target); if (!target.isAssignableFrom(String.class)) { throw new IllegalArgumentException("Target type must be assignable from String"); } if (!encoded.endsWith(EOF)) { throw new DiagnosticCodecException("Unsupported encoded input"); } return target.cast(encoded.substring(0, encoded.length() - 3)); } EmptyParameterDiagnosticCodec(); }
EmptyParameterDiagnosticCodec extends DiagnosticCodecSkeleton<String> { @Override public <T> T deserialize(String encoded, Class<T> target) throws DiagnosticCodecException { requireNonNull(encoded); requireNonNull(target); if (!target.isAssignableFrom(String.class)) { throw new IllegalArgumentException("Target type must be assignable from String"); } if (!encoded.endsWith(EOF)) { throw new DiagnosticCodecException("Unsupported encoded input"); } return target.cast(encoded.substring(0, encoded.length() - 3)); } EmptyParameterDiagnosticCodec(); @Override String serialize(Object o); @Override T deserialize(String encoded, Class<T> target); @Override String toString(); }
EmptyParameterDiagnosticCodec extends DiagnosticCodecSkeleton<String> { @Override public <T> T deserialize(String encoded, Class<T> target) throws DiagnosticCodecException { requireNonNull(encoded); requireNonNull(target); if (!target.isAssignableFrom(String.class)) { throw new IllegalArgumentException("Target type must be assignable from String"); } if (!encoded.endsWith(EOF)) { throw new DiagnosticCodecException("Unsupported encoded input"); } return target.cast(encoded.substring(0, encoded.length() - 3)); } EmptyParameterDiagnosticCodec(); @Override String serialize(Object o); @Override T deserialize(String encoded, Class<T> target); @Override String toString();  }