@Test public void testParseChar() { String name = "char(10)"; TypeInfo typeInfo = TypeInfoParser.getTypeInfoFromTypeString(name); Assert.assertTrue(typeInfo instanceof CharTypeInfo); Assert.assertEquals(typeInfo.getOdpsType(), OdpsType.CHAR); Assert.assertEquals(typeInfo.getTypeName(), name.toUpperCase()); Assert.assertEquals(((CharTypeInfo) typeInfo).getLength(), 10); name = "CHAR(20)"; typeInfo = TypeInfoParser.getTypeInfoFromTypeString(name); Assert.assertTrue(typeInfo instanceof CharTypeInfo); Assert.assertEquals(typeInfo.getOdpsType(), OdpsType.CHAR); Assert.assertEquals(typeInfo.getTypeName(), name.toUpperCase()); Assert.assertEquals(((CharTypeInfo) typeInfo).getLength(), 20); name = "ChaR(1)"; typeInfo = TypeInfoParser.getTypeInfoFromTypeString(name); Assert.assertTrue(typeInfo instanceof CharTypeInfo); Assert.assertEquals(typeInfo.getOdpsType(), OdpsType.CHAR); Assert.assertEquals(typeInfo.getTypeName(), name.toUpperCase()); Assert.assertEquals(((CharTypeInfo) typeInfo).getLength(), 1); }
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);  }