Skip to content

Commit

Permalink
programmatic config
Browse files Browse the repository at this point in the history
  • Loading branch information
dyu committed May 24, 2020
1 parent a0d0d09 commit 89ef89a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,20 @@ If you are to purely use this to replace java serialization (no compatibility wi
-Dprotostuff.runtime.morph_non_final_pojos=true
```

You can also customize it programmatically:
```java
static final DefaultIdStrategy STRATEGY = new DefaultIdStrategy(IdStrategy.DEFAULT_FLAGS
| IdStrategy.PRESERVE_NULL_ELEMENTS,
| IdStrategy.MORPH_COLLECTION_INTERFACES,
| IdStrategy.MORPH_MAP_INTERFACES,
| IdStrategy.MORPH_NON_FINAL_POJOS);
```

Use it:
```java
Schema<Foo> schema = RuntimeSchema.getSchema(Foo.class, STRATEGY);
```

Questions/Concerns/Suggestions
------------------------------

Expand Down

0 comments on commit 89ef89a

Please sign in to comment.