UniqueKeyIndex( HollowConsumer consumer, Class<T> uniqueType, PrimaryKey primaryTypeKey, List<MatchFieldPathArgumentExtractor<Q>> matchFields) { this.consumer = consumer; this.api = consumer.getAPI(); this.uniqueTypeName = uniqueType.getSimpleName(); this.uniqueTypeExtractor = SelectFieldPathResultExtractor .from(consumer.getAPI().getClass(), consumer.getStateEngine(), uniqueType, "", uniqueType); if (primaryTypeKey != null) { matchFields = validatePrimaryKeyFieldPaths(consumer, uniqueTypeName, primaryTypeKey, matchFields); } this.matchFields = matchFields; this.matchFieldPaths = matchFields.stream() .map(mf -> mf.fieldPath.toString()) .toArray(String[]::new); this.hpki = new HollowPrimaryKeyIndex(consumer.getStateEngine(), uniqueTypeName, matchFieldPaths); }