diff --git a/factory-kit/index.md b/factory-kit/index.md index 03fa53de0..c25701047 100644 --- a/factory-kit/index.md +++ b/factory-kit/index.md @@ -11,7 +11,7 @@ tags: --- ## Intent -Define factory of immutable content with separated builder and factory interfaces. +Define a factory of immutable content with separated builder and factory interfaces. ![alt text](./etc/factory-kit.png "Factory Kit") diff --git a/factory-kit/src/main/java/com/iluwatar/factorykit/App.java b/factory-kit/src/main/java/com/iluwatar/factorykit/App.java index 7b62678ba..91d1eb061 100644 --- a/factory-kit/src/main/java/com/iluwatar/factorykit/App.java +++ b/factory-kit/src/main/java/com/iluwatar/factorykit/App.java @@ -1,5 +1,18 @@ package com.iluwatar.factorykit; +/** + * Factory-kit is a creational pattern which defines a factory of immutable content + * with separated builder and factory interfaces to deal with the problem of + * creating one of the objects specified directly in the factory-kit instance. + * + *

+ * In the given example {@link WeaponFactory} represents the factory-kit, that contains + * four {@link Builder}s for creating new objects of + * the classes implementing {@link Weapon} interface. + *
Each of them can be called with {@link WeaponFactory#create(WeaponType)} method, with + * an input representing an instance of {@link WeaponType} that needs to + * be mapped explicitly with desired class type in the factory instance. + */ public class App { /** * Program entry point. diff --git a/factory-method/src/test/java/com/iluwatar/factory/method/FactoryMethodTest.java b/factory-method/src/test/java/com/iluwatar/factory/method/FactoryMethodTest.java index 7e82a37fa..2f8d1c9bb 100644 --- a/factory-method/src/test/java/com/iluwatar/factory/method/FactoryMethodTest.java +++ b/factory-method/src/test/java/com/iluwatar/factory/method/FactoryMethodTest.java @@ -93,9 +93,9 @@ public class FactoryMethodTest { * @param expectedWeaponType expected WeaponType of the weapon * @param clazz expected class of the weapon */ - private void verifyWeapon(Weapon weapon, WeaponType expectedWeaponType, Class clazz) { + private void verifyWeapon(Weapon weapon, WeaponType expectedWeaponType, Class clazz) { assertTrue("Weapon must be an object of: " + clazz.getName(), clazz.isInstance(weapon)); assertEquals("Weapon must be of weaponType: " + clazz.getName(), expectedWeaponType, weapon.getWeaponType()); } -} \ No newline at end of file +}