@Test public void getUnconvertedValueToSapMapsFields() { TestStructureBean bean = new TestStructureBean(); bean.javaField1 = Integer.MAX_VALUE; bean.javaField2 = Float.MAX_VALUE; Object value = structureMapping.getUnconvertedValueToSap(bean, converterCache); assertThat(value).isInstanceOf(Map.class); Map<String, Object> map = castToMap(value); assertThat(map.get("sapField1")).isEqualTo(Integer.MAX_VALUE); assertThat(map.get("sapField2")).isEqualTo(Float.MAX_VALUE); }
@Override protected Object getUnconvertedValueToSap(final Object bapiStructure, final ConverterCache converterCache) { HashMap<String, Object> functionMap = new HashMap<>(); for (ParameterMapping parameter : parameters) { Object fieldValue = ReflectionHelper.getFieldValue(bapiStructure, parameter.getJavaName()); if (fieldValue != null) { Object value = parameter.mapToSap(fieldValue, converterCache); functionMap.put(parameter.getSapName(), value); } } return functionMap; }
StructureMapping extends ParameterMapping { @Override protected Object getUnconvertedValueToSap(final Object bapiStructure, final ConverterCache converterCache) { HashMap<String, Object> functionMap = new HashMap<>(); for (ParameterMapping parameter : parameters) { Object fieldValue = ReflectionHelper.getFieldValue(bapiStructure, parameter.getJavaName()); if (fieldValue != null) { Object value = parameter.mapToSap(fieldValue, converterCache); functionMap.put(parameter.getSapName(), value); } } return functionMap; } }
StructureMapping extends ParameterMapping { @Override protected Object getUnconvertedValueToSap(final Object bapiStructure, final ConverterCache converterCache) { HashMap<String, Object> functionMap = new HashMap<>(); for (ParameterMapping parameter : parameters) { Object fieldValue = ReflectionHelper.getFieldValue(bapiStructure, parameter.getJavaName()); if (fieldValue != null) { Object value = parameter.mapToSap(fieldValue, converterCache); functionMap.put(parameter.getSapName(), value); } } return functionMap; } StructureMapping(final Class<?> associatedClass,
                            final String sapName,
                            final String javaName,
                            final Class<? extends Converter<?, ?>> converterClass); }
StructureMapping extends ParameterMapping { @Override protected Object getUnconvertedValueToSap(final Object bapiStructure, final ConverterCache converterCache) { HashMap<String, Object> functionMap = new HashMap<>(); for (ParameterMapping parameter : parameters) { Object fieldValue = ReflectionHelper.getFieldValue(bapiStructure, parameter.getJavaName()); if (fieldValue != null) { Object value = parameter.mapToSap(fieldValue, converterCache); functionMap.put(parameter.getSapName(), value); } } return functionMap; } StructureMapping(final Class<?> associatedClass,
                            final String sapName,
                            final String javaName,
                            final Class<? extends Converter<?, ?>> converterClass); void addParameter(final ParameterMapping param); Set<ParameterMapping> getParameters(); @Override ParamType getParamType(); @Override @Generated("") boolean equals(final Object o); @Override @Generated("") int hashCode(); }
StructureMapping extends ParameterMapping { @Override protected Object getUnconvertedValueToSap(final Object bapiStructure, final ConverterCache converterCache) { HashMap<String, Object> functionMap = new HashMap<>(); for (ParameterMapping parameter : parameters) { Object fieldValue = ReflectionHelper.getFieldValue(bapiStructure, parameter.getJavaName()); if (fieldValue != null) { Object value = parameter.mapToSap(fieldValue, converterCache); functionMap.put(parameter.getSapName(), value); } } return functionMap; } StructureMapping(final Class<?> associatedClass,
                            final String sapName,
                            final String javaName,
                            final Class<? extends Converter<?, ?>> converterClass); void addParameter(final ParameterMapping param); Set<ParameterMapping> getParameters(); @Override ParamType getParamType(); @Override @Generated("") boolean equals(final Object o); @Override @Generated("") int hashCode();  }