An ItemModelFactory is a ModelFactory that can wrap an ItemFacet and produce an ItemFacetModel for a given CharID
| 27 | * an ItemFacetModel for a given CharID |
| 28 | */ |
| 29 | public class ItemModelFactory implements ModelFactory |
| 30 | { |
| 31 | /** |
| 32 | * The ItemFacet for which this ItemModelFactory can produce a ModelFactory. |
| 33 | */ |
| 34 | private final ItemFacet<CharID, ?> facet; |
| 35 | |
| 36 | /** |
| 37 | * Constructs a new ItemModelFactory for the given ItemFacet. |
| 38 | * |
| 39 | * @param ifacet |
| 40 | * The ItemFacet for which this ItemModelFactory will produce |
| 41 | * ModelFactory objects |
| 42 | */ |
| 43 | public ItemModelFactory(ItemFacet<CharID, ?> ifacet) |
| 44 | { |
| 45 | facet = ifacet; |
| 46 | } |
| 47 | |
| 48 | @Override |
| 49 | public ItemFacetModel<?> generate(CharID id) |
| 50 | { |
| 51 | return new ItemFacetModel<>(id, facet); |
| 52 | } |
| 53 | } |
nothing calls this directly
no outgoing calls
no test coverage detected