![]() ERP Core API Developer Reference
|
fferpcore.DataTypeglobal class DataType Representation of a scalar data type. Methods
DataTypeglobal DataType(Schema.DisplayType type, Integer length, Integer scale) This constructor creates a class which is a representation of a scalar data type. This holds information about the type, length and scale of the data type. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. fferpcore.DataType example = new fferpcore.DataType(Schema.DisplayType.Double, 10, 5); System.assertEquals('DOUBLE', example.getName()); System.assertEquals(10, example.getLength()); System.assertEquals(5, example.getScale()); System.assertEquals('DOUBLE(10,5)', example.toString()); getNameglobal String getName() This method returns the name of the scalar data type this is associated with. See Salesforce's DisplayType Enum. Return ValueThis service returns a string object. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. fferpcore.DataType example = new fferpcore.DataType(Schema.DisplayType.Double, 10, 5); System.assertEquals('DOUBLE', example.getName()); System.assertEquals(10, example.getLength()); System.assertEquals(5, example.getScale()); System.assertEquals('DOUBLE(10,5)', example.toString()); getLengthglobal Integer getLength() This method returns the length of the scalar data type this it is associated with. If the data type has a length, for example String or Double, the length value is returned, otherwise NULL is returned. Return ValueThis service returns an Integer object. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. fferpcore.DataType example = new fferpcore.DataType(Schema.DisplayType.Double, 10, 5); System.assertEquals('DOUBLE', example.getName()); System.assertEquals(10, example.getLength()); System.assertEquals(5, example.getScale()); System.assertEquals('DOUBLE(10,5)', example.toString()); getScaleglobal Integer getScale() This method returns the scale of the scalar data type this it is associated with. If the data type has a scale, for example a Double, the scale value is returned, otherwise NULL is returned. Return ValueThis service returns an Integer object. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. fferpcore.DataType example = new fferpcore.DataType(Schema.DisplayType.Double, 10, 5); System.assertEquals('DOUBLE', example.getName()); System.assertEquals(10, example.getLength()); System.assertEquals(5, example.getScale()); System.assertEquals('DOUBLE(10,5)', example.toString()); toStringglobal override String toString() Display representation. Examples Boolean, String(64), Double(18,2) Return ValueThis service returns a string object. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. fferpcore.DataType example = new fferpcore.DataType(Schema.DisplayType.Double, 10, 5); System.assertEquals('DOUBLE', example.getName()); System.assertEquals(10, example.getLength()); System.assertEquals(5, example.getScale()); System.assertEquals('DOUBLE(10,5)', example.toString()); |