package io.druid.data.input.impl;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.metamx.common.parsers.ParserUtils;
import org.joda.time.DateTime;

import java.util.Map;

/**
 */
public class TimestampSpec
{
  private static final String defaultFormat = "auto";

  private final String timestampColumn;
  private final String timestampFormat;
  private final Function<String, DateTime> timestampConverter;

  @JsonCreator
  public TimestampSpec(
      @JsonProperty("column") String timestampColumn,
      @JsonProperty("format") String format
  )
  {
    Preconditions.checkNotNull(timestampColumn, "Must have a timestamp column!");
    this.timestampColumn = timestampColumn.toLowerCase();
    this.timestampFormat = format == null ? defaultFormat : format;
    this.timestampConverter = ParserUtils.createTimestampParser(timestampFormat);
  }

  @JsonProperty("column")
  public String getTimestampColumn()
  {
    return timestampColumn;
  }

  @JsonProperty("format")
  public String getTimestampFormat()
  {
    return timestampFormat;
  }

  public DateTime extractTimestamp(Map<String, Object> input)
  {
    final Object o = input.get(timestampColumn);

    return o == null ? null : timestampConverter.apply(o.toString());
  }
}

@@ -710,65 +710,32 @@
     
-Preconditions.checkNotNull(timestampColumn, %22Must have a 
+this.timestampColumn = (
 time
@@ -743,46 +743,32 @@
 tamp
- c
+C
 olumn
-!%22);%0A    this.timestampColumn =
+ == null) ? null :
  tim

fix some backwards compat issues