@Override
    public String toString() {
      return "DurationGranularity{" + "length=" + length + ", origin=" + origin + '}';
    }
UDFDateFloor.

Abstract class that converts a timestamp to a timestamp with a given granularity.
ql/src/java/org/apache/hadoop/hive/ql/udf/UDFDateFloor.java