docs: update abstract factory

This commit is contained in:
Ilkka Seppälä
2024-02-11 17:45:06 +02:00
parent 6f8a95debd
commit a1f527eb28
3 changed files with 32 additions and 14 deletions
@@ -24,6 +24,7 @@
*/
package com.iluwatar.abstractfactory;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
/**
@@ -41,14 +42,11 @@ import lombok.extern.slf4j.Slf4j;
* both concrete implementations to create a king, a castle, and an army.
*/
@Slf4j
@Getter
public class App implements Runnable {
private final Kingdom kingdom = new Kingdom();
public Kingdom getKingdom() {
return kingdom;
}
/**
* Program entry point.
*
@@ -57,7 +57,6 @@ public class Kingdom {
return switch (type) {
case ELF -> new ElfKingdomFactory();
case ORC -> new OrcKingdomFactory();
default -> throw new IllegalArgumentException("KingdomType not supported.");
};
}
}