mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-16 10:59:03 +00:00
[refactor] Update flyweight pattern.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.iluwatar;
|
||||
|
||||
import java.util.EnumMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -12,7 +13,7 @@ import java.util.EnumMap;
|
||||
*/
|
||||
public class PotionFactory {
|
||||
|
||||
private EnumMap<PotionType, Potion> potions;
|
||||
private final Map<PotionType, Potion> potions;
|
||||
|
||||
public PotionFactory() {
|
||||
potions = new EnumMap<>(PotionType.class);
|
||||
|
||||
Reference in New Issue
Block a user