...
- Developer Documentation
- C3.ai Academy Videos
- C3 Fundamentals module 'TypeSystem': https://learnc3.litmos.com/course/3802349/module/7466519
- Annotations
- Db Annotations
- C3 Fundamentals module 'TypeSystem': https://learnc3.litmos.com/course/3802349/module/7466519
Final Keyword
Types, methods, and fields can be made 'final' using the 'final' keyword. This prevents fields and methods from being overridden by any type which mixes them in. If a type is made final, all fields and methods of that type are made final.
Code Block |
---|
type FinalType {
final method: function(): string
} |
C3.ai developer resources on the final keyword
- Developer Documentation
Abstract Types
The C3 AI Suite also supports abstract types. If you use the keyword 'abstract' before the type definition, this will indicate an abstract type. You cannot instantiate an abstract type, and must mix it into another concrete type. This provides a great way to standardize interfaces. Here's an example:
Code Block |
---|
abstract type Interace {
field1: int
method1: function(double): int
} |
C3.ai developer resources on Abstract types:
- Developer Documentation
- C3.ai Academy Videos
- C3 Fundamentals module '
Examples
Look through the lightbulbAD package and find .c3typ files. Look at these to see the range of possibilities