Standard Library
The Vertex standard library is small on purpose. Most of its surface
area is built around the core types you already meet in the
Language Tour: primitives, Option, Result,
and collections. This section documents the supporting types that are
also available globally.
By domain
Section titled “By domain”Numbers
Section titled “Numbers”Built-in numeric primitives (Int, Long, Double, Decimal) each
carry a small set of methods on their instance (conversion,
arithmetic helpers, parsing from String). See
Numeric methods.
| Use | Type |
|---|---|
| Whole numbers, 32-bit range | Int |
| Whole numbers, 64-bit range | Long |
| Fractional, IEEE-754 | Double |
| Fractional, precise (money) | Decimal |
Strings
Section titled “Strings”String values carry the usual assortment of query and transform
methods (length, toUpperCase, contains, split, trim, …). See
String methods.
Dates and times
Section titled “Dates and times”There are three date-related types, each with a different job:
| Use | Type |
|---|---|
| A calendar date (no time-of-day) | Date |
| A specific moment, including time-of-day | DateTime |
Formatting a Date or DateTime to a String | DateFormat |
See Date, DateTime, and DateFormat.
Collections
Section titled “Collections”Full documentation for List<T>, Map<K, V>, and Set<T> lives in
the main reference under
Collections. They are not repeated here.
Error handling
Section titled “Error handling”Option<T> and Result<T, E> are the core types for absence and
failure. See Option and
Result.
Conventions across the stdlib
Section titled “Conventions across the stdlib”- Methods are camelCase.
toUpperCase,unwrapOr,filterMapSome. - Methods that might not produce a value return
Option.List.first(),List.get(i),Map.get(k),String.indexOf(...). - Methods that might fail return
Result. Parsing, construction with validation. - Pure by default. Collection methods return new values; they do
not mutate the receiver. The
mutablekeyword is reserved for reassignment, not for hidden in-place mutation. - No overloading. One name, one signature. If you see a second form, it is a different method with a different name.
What is not in the stdlib
Section titled “What is not in the stdlib”- No I/O beyond
debug. Reading files, network calls, and environment variables are Apex-runtime concerns; useexterndeclarations to call the appropriate Apex APIs. - No threading primitives. Apex’s execution model is synchronous within a transaction; Vertex reflects that.
- No random. If you need randomness, go through
System.Cryptoor similar via Apex FFI.