docs: update tolerant reader

This commit is contained in:
Ilkka Seppälä
2024-05-22 15:40:55 +03:00
parent 628ec1548c
commit 6ed6b1c0f0
6 changed files with 142 additions and 149 deletions
@@ -28,7 +28,7 @@ import java.io.IOException;
import lombok.extern.slf4j.Slf4j;
/**
* Tolerant Reader is an integration pattern that helps creating robust communication systems. The
* Tolerant Reader is an integration pattern that helps to create robust communication systems. The
* idea is to be as tolerant as possible when reading data from another service. This way, when the
* communication schema changes, the readers must not break.
*
@@ -24,6 +24,7 @@
*/
package com.iluwatar.tolerantreader;
import java.io.Serial;
import java.io.Serializable;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@@ -35,6 +36,7 @@ import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public class RainbowFish implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private final String name;
@@ -30,6 +30,7 @@ import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Map;
import lombok.NoArgsConstructor;
/**
* RainbowFishSerializer provides methods for reading and writing {@link RainbowFish} objects to
@@ -37,14 +38,12 @@ import java.util.Map;
* RainbowFish} objects. This way the reader does not break even though new properties are added to
* the schema.
*/
@NoArgsConstructor
public final class RainbowFishSerializer {
public static final String LENGTH_METERS = "lengthMeters";
public static final String WEIGHT_TONS = "weightTons";
private RainbowFishSerializer() {
}
/**
* Write V1 RainbowFish to file.
*/
@@ -24,6 +24,7 @@
*/
package com.iluwatar.tolerantreader;
import java.io.Serial;
import lombok.Getter;
/**
@@ -32,6 +33,7 @@ import lombok.Getter;
@Getter
public class RainbowFishV2 extends RainbowFish {
@Serial
private static final long serialVersionUID = 1L;
private boolean sleeping;