Sha256: 09880e3503125e3131a9d3fa14ec3ab6ed6ba1648193a40cd7852eb528d179f4
Contents?: true
Size: 1.08 KB
Versions: 12
Compression:
Stored size: 1.08 KB
Contents
package org.embulk.filter.timestamp_format.cast; import org.embulk.filter.timestamp_format.TimestampFormatter; import org.embulk.filter.timestamp_format.TimestampUnit; import org.embulk.spi.DataException; import org.embulk.spi.time.Timestamp; public class LongCast { private LongCast() {} public static String asString(long value, TimestampUnit fromUnit, TimestampFormatter formatter) throws DataException { Timestamp timestamp = TimestampUnit.toTimestamp(value, fromUnit); return formatter.format(timestamp); } public static Timestamp asTimestamp(long value, TimestampUnit fromUnit) throws DataException { return TimestampUnit.toTimestamp(value, fromUnit); } public static long asLong(long value, TimestampUnit fromUnit, TimestampUnit toUnit) throws DataException { return TimestampUnit.changeUnit(value, fromUnit, toUnit); } public static double asDouble(long value, TimestampUnit fromUnit, TimestampUnit toUnit) throws DataException { return (double) TimestampUnit.changeUnit(value, fromUnit, toUnit); } }
Version data entries
12 entries across 12 versions & 1 rubygems