@Test public void testParseStringInvalid() { assertThat(converter.parseString(IVector2.class, "42;133a7")).isEqualTo(Vector2.zero()); assertThat(converter.parseString(IVector3.class, "42;1337,3.a14")).isEqualTo(Vector3.zero()); assertThat(converter.parseString(IVectorN.class, "42;1337,3.14,-5a")).isEqualTo(VectorN.zero(0)); assertThat(converter.parseString(IVector.class, "4a2;1337")).isEqualTo(VectorN.zero(0)); assertThat(converter.parseString(Object.class, "")).isNull(); }
@Override public Object parseString(final Class<?> impl, final String value) { if (impl.equals(IVector2.class)) { return parseVector2(value); } else if (impl.equals(IVector3.class)) { return parseVector3(value); } else if (impl.equals(IVectorN.class) || impl.equals(IVector.class)) { return parseVectorN(value); } return null; }
VectorConverter implements IString2ValueConverter { @Override public Object parseString(final Class<?> impl, final String value) { if (impl.equals(IVector2.class)) { return parseVector2(value); } else if (impl.equals(IVector3.class)) { return parseVector3(value); } else if (impl.equals(IVectorN.class) || impl.equals(IVector.class)) { return parseVectorN(value); } return null; } }
VectorConverter implements IString2ValueConverter { @Override public Object parseString(final Class<?> impl, final String value) { if (impl.equals(IVector2.class)) { return parseVector2(value); } else if (impl.equals(IVector3.class)) { return parseVector3(value); } else if (impl.equals(IVectorN.class) || impl.equals(IVector.class)) { return parseVectorN(value); } return null; }  }
VectorConverter implements IString2ValueConverter { @Override public Object parseString(final Class<?> impl, final String value) { if (impl.equals(IVector2.class)) { return parseVector2(value); } else if (impl.equals(IVector3.class)) { return parseVector3(value); } else if (impl.equals(IVectorN.class) || impl.equals(IVector.class)) { return parseVectorN(value); } return null; }  @Override boolean supportedClass(final Class<?> impl); @Override Object parseString(final Class<?> impl, final String value); @Override String toString(final Class<?> impl, final Object value); }
VectorConverter implements IString2ValueConverter { @Override public Object parseString(final Class<?> impl, final String value) { if (impl.equals(IVector2.class)) { return parseVector2(value); } else if (impl.equals(IVector3.class)) { return parseVector3(value); } else if (impl.equals(IVectorN.class) || impl.equals(IVector.class)) { return parseVectorN(value); } return null; }  @Override boolean supportedClass(final Class<?> impl); @Override Object parseString(final Class<?> impl, final String value); @Override String toString(final Class<?> impl, final Object value);  }