@Test public void doesNotTruncateFieldWhenStringNull() { var facilityName = "Dortmund"; var modelName = "Cool Car"; var productionDate = LocalDate.of(2019, 4, 23); var car = new Car(productionDate, facilityName, modelName, null); var truncatedCar = FieldTruncationUtils.truncateStringsToColumnLengths(car); assertThat(truncatedCar).isEqualTo(car); }
public static <T> T truncateStringsToColumnLengths(@NonNull T entity) { ReflectionUtils.doWithFields(entity.getClass(), new StringTruncationFieldCallback(entity), new StringFieldFilter()); return entity; }
FieldTruncationUtils { public static <T> T truncateStringsToColumnLengths(@NonNull T entity) { ReflectionUtils.doWithFields(entity.getClass(), new StringTruncationFieldCallback(entity), new StringFieldFilter()); return entity; } }
FieldTruncationUtils { public static <T> T truncateStringsToColumnLengths(@NonNull T entity) { ReflectionUtils.doWithFields(entity.getClass(), new StringTruncationFieldCallback(entity), new StringFieldFilter()); return entity; }  }
FieldTruncationUtils { public static <T> T truncateStringsToColumnLengths(@NonNull T entity) { ReflectionUtils.doWithFields(entity.getClass(), new StringTruncationFieldCallback(entity), new StringFieldFilter()); return entity; }  static T truncateStringsToColumnLengths(@NonNull T entity); }
FieldTruncationUtils { public static <T> T truncateStringsToColumnLengths(@NonNull T entity) { ReflectionUtils.doWithFields(entity.getClass(), new StringTruncationFieldCallback(entity), new StringFieldFilter()); return entity; }  static T truncateStringsToColumnLengths(@NonNull T entity); static final int DEFAULT_COLUMN_LENGTH; }