ObjectConverter implements ConverterWrapper<Object, Object> { @Override public Object convertToAxiomValue(Object value) { if (IdentifierTransformer.isValidIdentifierType(value.getClass()) && !(value instanceof String)) { return NamedResource.create(IdentifierTransformer.valueAsUri(value)); } return value; } ObjectConverter();  ObjectConverter(boolean preferMultilingualString); @Override Object convertToAxiomValue(Object value); @Override Object convertToAttribute(Object value); @Override boolean supportsAxiomValueType(Class<?> type); boolean doesPreferMultilingualString();  }
@Test void convertToAxiomValueDoesNothingToLiteralValues() { final Object valueOne = "117"; final Object valueTwo = 1237; assertSame(valueOne, sut.convertToAxiomValue(valueOne)); assertSame(valueTwo, sut.convertToAxiomValue(valueTwo)); }
@Test void convertToAxiomValueTransformsIdentifierValueToNamedResource() throws Exception { final URL valueOne = Generators.createIndividualIdentifier().toURL(); final URI valueTwo = Generators.createIndividualIdentifier(); assertEquals(NamedResource.create(valueOne.toString()), sut.convertToAxiomValue(valueOne)); assertEquals(NamedResource.create(valueTwo), sut.convertToAxiomValue(valueTwo)); }