@Test public void testParseDecimal() { String decimal = "DECIMAL(19,4)"; TypeInfo typeInfo = TypeInfoParser.getTypeInfoFromTypeString(decimal); Assert.assertTrue(typeInfo instanceof DecimalTypeInfo); Assert.assertEquals(typeInfo.getTypeName(), decimal.toUpperCase()); Assert.assertEquals(((DecimalTypeInfo) typeInfo).getPrecision(), 19); Assert.assertEquals(((DecimalTypeInfo) typeInfo).getScale(), 4); decimal = "decimal(3,2)"; typeInfo = TypeInfoParser.getTypeInfoFromTypeString(decimal); Assert.assertTrue(typeInfo instanceof DecimalTypeInfo); Assert.assertEquals(typeInfo.getTypeName(), decimal.toUpperCase()); Assert.assertEquals(((DecimalTypeInfo) typeInfo).getPrecision(), 3); Assert.assertEquals(((DecimalTypeInfo) typeInfo).getScale(), 2); decimal = "DecimaL(5,0)"; typeInfo = TypeInfoParser.getTypeInfoFromTypeString(decimal); Assert.assertTrue(typeInfo instanceof DecimalTypeInfo); Assert.assertEquals(typeInfo.getTypeName(), decimal.toUpperCase()); Assert.assertEquals(((DecimalTypeInfo) typeInfo).getPrecision(), 5); Assert.assertEquals(((DecimalTypeInfo) typeInfo).getScale(), 0); }
public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); }
TypeInfoParser { public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); } }
TypeInfoParser { public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); } TypeInfoParser(String name); }
TypeInfoParser { public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); } TypeInfoParser(String name); static TypeInfo getTypeInfoFromTypeString(String name); }
TypeInfoParser { public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); } TypeInfoParser(String name); static TypeInfo getTypeInfoFromTypeString(String name);  }