DatumFactory { public static TextDatum createText(String val) { return new TextDatum(val); }  static Class<? extends Datum> getDatumClass(Type type); static Datum createFromString(DataType dataType, String value); static Datum createFromBytes(DataType dataType, byte[] bytes); static Datum createFromInt4(DataType type, int val); static Datum createFromInt8(DataType type, long val); static NullDatum createNullDatum(); static Datum createBool(byte val); static Datum createBool(int val); static BooleanDatum createBool(boolean val); static BitDatum createBit(byte val); static CharDatum createChar(char val); static CharDatum createChar(byte val); static CharDatum createChar(byte[] bytes); static CharDatum createChar(String val); static Int2Datum createInt2(short val); static Int2Datum createInt2(String val); static Int4Datum createInt4(int val); static Int4Datum createInt4(String val); static Int8Datum createInt8(long val); static Int8Datum createInt8(String val); static Float4Datum createFloat4(float val); static Float4Datum createFloat4(String val); static Float8Datum createFloat8(double val); static Float8Datum createFloat8(String val); static TextDatum createText(String val); static TextDatum createText(byte[] val); static DateDatum createDate(int instance); static DateDatum createDate(int year, int month, int day); static DateDatum createDate(String dateStr); static TimeDatum createTime(long instance); static TimeDatum createTime(String timeStr); static TimeDatum createTime(String timeStr, TimeZone tz); static TimestampDatum createTimestmpDatumWithJavaMillis(long millis); static TimestampDatum createTimestmpDatumWithUnixTime(int unixTime); static TimestampDatum createTimestamp(String datetimeStr); static TimestampDatum createTimestamp(String datetimeStr, TimeZone tz); static IntervalDatum createInterval(String intervalStr); @SuppressWarnings("unused") static IntervalDatum createInterval(long interval); static IntervalDatum createInterval(int month, long interval); static DateDatum createDate(Datum datum); static TimeDatum createTime(Datum datum, @Nullable TimeZone tz); static TimestampDatum createTimestamp(Datum datum, @Nullable TimeZone tz); @SuppressWarnings("unused") static TimestampDatum createTimestamp(long julianTimestamp); static TimestampDatum parseTimestamp(String str, @Nullable TimeZone tz); static BlobDatum createBlob(byte[] encoded); static BlobDatum createBlob(byte[] encoded, int offset, int length); static BlobDatum createBlob(String plainString); static Inet4Datum createInet4(int encoded); static Inet4Datum createInet4(byte[] val); static Inet4Datum createInet4(byte[] val, int offset, int length); static Inet4Datum createInet4(String val); static AnyDatum createAny(Datum val); static Datum cast(Datum operandDatum, DataType target, @Nullable TimeZone tz);  }
@Test public final void testCreateString() { Datum d = DatumFactory.createText("12345a"); assertEquals(Type.TEXT, d.type()); }