enhancement: Refactor and add explanation for value object (#1942)

Co-authored-by: Subhrodip Mohanta <hello@subho.xyz>
This commit is contained in:
Ilkka Seppälä
2022-01-08 14:31:09 +02:00
committed by GitHub
parent 2d2dec98e8
commit 4f8007d674
3 changed files with 74 additions and 26 deletions
@@ -43,7 +43,7 @@ import lombok.extern.slf4j.Slf4j;
public class App {
/**
* This practice creates three HeroStats(Value object) and checks equality between those.
* This example creates three HeroStats (value objects) and checks equality between those.
*/
public static void main(String[] args) {
var statA = HeroStat.valueOf(10, 5, 0);
@@ -51,6 +51,8 @@ public class App {
var statC = HeroStat.valueOf(5, 1, 8);
LOGGER.info(statA.toString());
LOGGER.info(statB.toString());
LOGGER.info(statC.toString());
LOGGER.info("Is statA and statB equal : {}", statA.equals(statB));
LOGGER.info("Is statA and statC equal : {}", statA.equals(statC));