Examples

In this section you can explore various example usages of LiquidJava, with focused code snippets to illustrate specific features and use cases.

Counter

A simple refinement example for ensuring a counter never decrements below zero.

Pagination

Plain refinements with aliases for page numbers, page sizes, and computed offsets.

Media Player

A typestate protocol for a simple media player.

Email

A typestate protocol for an Email builder API.

Order

A typestate protocol for a simple order processing system.

Downloader

A typestate protocol for a downloader object.

Connection

A typestate protocol with a value-dependent conditional transition.

ArrayList

An external refinement for ArrayList that prevents out-of-bounds access.