MCPcopy Create free account
hub / github.com/PCGen/pcgen / ItemModelFactory

Class ItemModelFactory

code/src/java/pcgen/output/factory/ItemModelFactory.java:29–53  ·  view source on GitHub ↗

An ItemModelFactory is a ModelFactory that can wrap an ItemFacet and produce an ItemFacetModel for a given CharID

Source from the content-addressed store, hash-verified

27 * an ItemFacetModel for a given CharID
28 */
29public 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected