Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
stefankoppier committed Jul 28, 2024
1 parent 8a802dc commit a5bccdc
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class BuiltinMappieDefinitionsCollector {
"ByteToIntMapper",
"ByteToLongMapper",
"ByteToBigIntegerMapper",
"CharToStringMapper",
)
}
}
Expand Down
1 change: 1 addition & 0 deletions website/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ changelog:
items:
- "[#69](https://github.com/Mr-Mappie/mappie/issues/69) enum mappers can now be generated automatically if source and target contain the same entries."
- "[#68](https://github.com/Mr-Mappie/mappie/issues/68) other mappers are automatically resolved in mappings and applied using the via operator."
- "[#73](https://github.com/Mr-Mappie/mappie/issues/73) added multiple built-in mappers."
- date: "2024-07-17"
title: "v0.5.0"
items:
Expand Down
2 changes: 1 addition & 1 deletion website/src/posts/enum-mapping/posts/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ summary: "Enum mapping configuration."
eleventyNavigation:
key: Enum Mapping Configuration
parent: Enum Mapping
order: 15
order: 16
---

By default, all enum sources must have a defined target. This can be disabled by adding the following
Expand Down
2 changes: 1 addition & 1 deletion website/src/posts/enum-mapping/posts/entry-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ summary: "Mapping enum entry values."
eleventyNavigation:
key: Entry Mapping
parent: Enum Mapping
order: 14
order: 15
---

Not all enums classes that one wants to map have identical entries, or are not even both an enum class. If this is the case,
Expand Down
2 changes: 1 addition & 1 deletion website/src/posts/enum-mapping/posts/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ summary: "Performing enum mapping."
eleventyNavigation:
key: Enum Mapping Overview
parent: Enum Mapping
order: 13
order: 14
---

Mappie supports mapping an enum class to another class. This can be achieved by implementing a mapper which extends
Expand Down
38 changes: 38 additions & 0 deletions website/src/posts/object-mapping/posts/built-in.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: "Built-in Mappers"
summary: "Built-in Mappers."
eleventyNavigation:
key: Built-in Mappers
parent: Object Mapping
order: 12
---

Mappie comes with several safe built-in mappers. These mappers are defined in the package `tech.mappie.api.builtin` and
can be applied explicitly, or implicitly.

The types below that are in *cursive* are not available on all platforms. For example, `BigInteger` is only available
on the JVM platform.

## Numeric Mappers
The following numeric mappers are built-int.

| | Byte | Short | Int | Long | *BigInteger* |
|--------------|------|-------|-----|------|--------------|
| Byte | | X | X | X | X |
| Short | | | X | X | X |
| Int | | | | X | X |
| Long | | | | | X |

## Char Mappers
The following char mappers are built-int

| | Char | String |
|--------|------|--------|
| Char | | X |

## LocalDate Mappers
The following numeric mappers are built-int

| | *LocalDateTime* | *LocalTime* | *LocalDate* |
|-----------------|-----------------|-------------|-------------|
| *LocalDateTime* | | X | X |
2 changes: 1 addition & 1 deletion website/src/posts/object-mapping/posts/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ summary: "Object Mapping Configuration."
eleventyNavigation:
key: Object Mapping Configuration
parent: Object Mapping
order: 12
order: 13
---

## Ignoring Visibility
Expand Down
3 changes: 2 additions & 1 deletion website/src/posts/object-mapping/posts/implicit.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ eleventyNavigation:
Mappie infers implicit mappings by name, type, default arguments, getter- and setter methods, and other mappers that
are defined. An implicit mapping for a target property is inferred automatically if it has the same name as a source
property, and it is assignable from that source property. If it is not assignable, Mappie will check if there is a
single mapper defined that can map the source type to the target type, and will automatically apply it.
single mapper defined that can map the source type to the target type, and will automatically apply it. Mappie comes
with several mappers out of the box. See [Built-in Mappers](/object-mapping/built-in/).

For example, suppose we have a data class `Person` and a data class `PersonDto`
```kotlin
Expand Down

0 comments on commit a5bccdc

Please sign in to comment.