Lesson 09: Data Types (Slides)
Please review the following resources before lecture:
- Learn Java Primitive Data Types in 5 Minutes (Video)
- Java Classes & Objects (Video)
- TypeScript Tutorial #12 - Classes (Video)
- Complete data types exercise.
For this exercise, you will use your knowledge of data types to identify the appropriate type to store and process data. You will run a program to generate a unique file with sample data, then write code to provide the correct data type of each column.
- Execute the app providing a unique provider name.
cd lesson_09/types
./gradlew bootRun --args="yourprovidername" # Substitute with your own value
- Examine the file that was created for you in the resources/data folder. The file will be formatted using the JSON data format.
- Next, you will create a
DataProvider
implementation that will provide information about the data types for the columns in the file (e.g.column1
,column2
, etc.). You can view the example AnthonyMaysProvider.java file. - Customize the data types map by choosing the closest appropriate data type of each column. Each data type should only be used once.
- Make sure to apply the formatter and run the tests to confirm that you've implemented everything correctly.
./gradlew spotlessApply
./gradlew check
- You are to submit a PR with your
DataProvider
implementation and the generated.json
file that was produced for you. All build checks must pass in order to receive full credit.