@Test void testConvertNull() { assertThat(converter.convert(null, mock(EAttribute.class))).isNull(); }
@Override public Object convert(@Nullable Object value, EAttribute attribute) { if (isNull(value)) { return null; } final EDataType dataType = attribute.getEAttributeType(); if (!(dataType instanceof EEnum) && Primitives.isPrimitiveOrString(dataType.getInstanceClass())) { return value; } if (FeatureMapUtil.isFeatureMapEntry(dataType)) { return featureMapConverter.convert((FeatureMap.Entry) value, attribute); } return EcoreUtil.convertToString(dataType, value); }
AttributeConverter implements BiConverter<Object, EAttribute, Object> { @Override public Object convert(@Nullable Object value, EAttribute attribute) { if (isNull(value)) { return null; } final EDataType dataType = attribute.getEAttributeType(); if (!(dataType instanceof EEnum) && Primitives.isPrimitiveOrString(dataType.getInstanceClass())) { return value; } if (FeatureMapUtil.isFeatureMapEntry(dataType)) { return featureMapConverter.convert((FeatureMap.Entry) value, attribute); } return EcoreUtil.convertToString(dataType, value); } }
AttributeConverter implements BiConverter<Object, EAttribute, Object> { @Override public Object convert(@Nullable Object value, EAttribute attribute) { if (isNull(value)) { return null; } final EDataType dataType = attribute.getEAttributeType(); if (!(dataType instanceof EEnum) && Primitives.isPrimitiveOrString(dataType.getInstanceClass())) { return value; } if (FeatureMapUtil.isFeatureMapEntry(dataType)) { return featureMapConverter.convert((FeatureMap.Entry) value, attribute); } return EcoreUtil.convertToString(dataType, value); } AttributeConverter(FeatureMapConverter featureMapConverter); }
AttributeConverter implements BiConverter<Object, EAttribute, Object> { @Override public Object convert(@Nullable Object value, EAttribute attribute) { if (isNull(value)) { return null; } final EDataType dataType = attribute.getEAttributeType(); if (!(dataType instanceof EEnum) && Primitives.isPrimitiveOrString(dataType.getInstanceClass())) { return value; } if (FeatureMapUtil.isFeatureMapEntry(dataType)) { return featureMapConverter.convert((FeatureMap.Entry) value, attribute); } return EcoreUtil.convertToString(dataType, value); } AttributeConverter(FeatureMapConverter featureMapConverter); @Override Object convert(@Nullable Object value, EAttribute attribute); @Override Object revert(@Nullable Object value, EAttribute attribute); }
AttributeConverter implements BiConverter<Object, EAttribute, Object> { @Override public Object convert(@Nullable Object value, EAttribute attribute) { if (isNull(value)) { return null; } final EDataType dataType = attribute.getEAttributeType(); if (!(dataType instanceof EEnum) && Primitives.isPrimitiveOrString(dataType.getInstanceClass())) { return value; } if (FeatureMapUtil.isFeatureMapEntry(dataType)) { return featureMapConverter.convert((FeatureMap.Entry) value, attribute); } return EcoreUtil.convertToString(dataType, value); } AttributeConverter(FeatureMapConverter featureMapConverter); @Override Object convert(@Nullable Object value, EAttribute attribute); @Override Object revert(@Nullable Object value, EAttribute attribute);  }