Skip to content

Commit cfd83b5

Browse files
committed
issue iluwatar#333 review changes
1 parent 6ab9b36 commit cfd83b5

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

factory-kit/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ tags:
1111
---
1212

1313
## Intent
14-
Define factory of immutable content with separated builder and factory interfaces.
14+
Define a factory of immutable content with separated builder and factory interfaces.
1515

1616
![alt text](./etc/factory-kit.png "Factory Kit")
1717

factory-kit/src/main/java/com/iluwatar/factorykit/App.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
package com.iluwatar.factorykit;
22

3+
/**
4+
* Factory-kit is a creational pattern which defines a factory of immutable content
5+
* with separated builder and factory interfaces to deal with the problem of
6+
* creating one of the objects specified directly in the factory-kit instance.
7+
*
8+
* <p>
9+
* In the given example {@link WeaponFactory} represents the factory-kit, that contains
10+
* four {@link Builder}s for creating new objects of
11+
* the classes implementing {@link Weapon} interface.
12+
* <br>Each of them can be called with {@link WeaponFactory#create(WeaponType)} method, with
13+
* an input representing an instance of {@link WeaponType} that needs to
14+
* be mapped explicitly with desired class type in the factory instance.
15+
*/
316
public class App {
417
/**
518
* Program entry point.

factory-method/src/test/java/com/iluwatar/factory/method/FactoryMethodTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ public void testElfBlacksmithWithSpear() {
9393
* @param expectedWeaponType expected WeaponType of the weapon
9494
* @param clazz expected class of the weapon
9595
*/
96-
private void verifyWeapon(Weapon weapon, WeaponType expectedWeaponType, Class clazz) {
96+
private void verifyWeapon(Weapon weapon, WeaponType expectedWeaponType, Class<?> clazz) {
9797
assertTrue("Weapon must be an object of: " + clazz.getName(), clazz.isInstance(weapon));
9898
assertEquals("Weapon must be of weaponType: " + clazz.getName(), expectedWeaponType,
9999
weapon.getWeaponType());
100100
}
101-
}
101+
}

0 commit comments

Comments
 (0)