Skip to content

Commit

Permalink
docs: Add table for collection interfaces and implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
Clashsoft committed Nov 5, 2020
1 parent d75356b commit 8a4ed6b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions doc/ClassModelDefinition.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,16 @@ public class Page

The generated code shows that `ArrayList` was automatically chosen as the implementation class for `List`.
Other collection int, like `Set`, have other default implementation types.
You can also specify the implement directly if you don't want to use the default.
The following tables shows interfaces
You can also specify the implementation type manually if you don't want to use the default -- fulib will automatically infer the most specific interface.
The following tables shows the mapping from interfaces to default implementations.

| Interface | Default Implementation |
|----------------|------------------------|
| `Collection` | `LinkedHashSet` |
| `Set` | `LinkedHashSet` |
| `SortedSet` | `TreeSet` |
| `NavigableSet` | `TreeSet` |
| `List` | `ArrayList` |

Attributes can be turned into associations and customized using a number of annotations, which are covered in the following sections.

Expand Down

0 comments on commit 8a4ed6b

Please sign in to comment.