@@ -30,7 +30,6 @@ export class TraversalStrategies {
3030 /**
3131 * Creates a new instance of TraversalStrategies.
3232 * @param {TraversalStrategies } [parent] The parent strategies from where to clone the values from.
33- * @constructor
3433 */
3534 constructor ( parent ?: TraversalStrategies ) {
3635 if ( parent ) {
@@ -106,7 +105,7 @@ export class ElementIdStrategy extends TraversalStrategy {
106105
107106export class HaltedTraverserStrategy extends TraversalStrategy {
108107 /**
109- * @param {String } haltedTraverserFactory full qualified class name in Java of a { @code HaltedTraverserFactory} implementation
108+ * @param {String } haltedTraverserFactory full qualified class name in Java of a ` HaltedTraverserFactory` implementation
110109 */
111110 constructor ( { haltedTraverserFactory = "" } ) {
112111 super ( { haltedTraverserFactory : haltedTraverserFactory } ) ;
@@ -127,14 +126,19 @@ export class OptionsStrategy extends TraversalStrategy {
127126
128127export class PartitionStrategy extends TraversalStrategy {
129128 /**
130- * @param { Object } [ options]
131- * @param { String } [ options.partitionKey] name of the property key to partition by
132- * @param { String } [ options.writePartition] the value of the currently write partition
133- * @param { Array<String> } [ options.readPartitions] list of strings representing the partitions to include for reads
134- * @param { boolean } [ options.includeMetaProperties] determines if meta-properties should be included in partitioning defaulting to false
129+ * @param options
130+ * @param options.partitionKey - name of the property key to partition by
131+ * @param options.writePartition - the value of the currently write partition
132+ * @param options.readPartitions - list of strings representing the partitions to include for reads
133+ * @param options.includeMetaProperties - determines if meta-properties should be included in partitioning defaulting to false
135134 */
136- constructor ( options : TraversalStrategyConfiguration ) {
137- super ( options ) ;
135+ constructor ( { partitionKey, writePartition, readPartitions, includeMetaProperties} : { partitionKey ?: string , writePartition ?: string , readPartitions ?: string [ ] , includeMetaProperties ?: boolean } = { } ) {
136+ const config : Record < string , any > = { } ;
137+ if ( partitionKey !== undefined ) config . partitionKey = partitionKey ;
138+ if ( writePartition !== undefined ) config . writePartition = writePartition ;
139+ if ( readPartitions !== undefined ) config . readPartitions = readPartitions ;
140+ if ( includeMetaProperties !== undefined ) config . includeMetaProperties = includeMetaProperties ;
141+ super ( config ) ;
138142 }
139143}
140144
@@ -146,33 +150,29 @@ export class ProfileStrategy extends TraversalStrategy {
146150
147151export class SubgraphStrategy extends TraversalStrategy {
148152 /**
149- * @param { Object } [ options]
150- * @param { GraphTraversal } [ options.vertices] name of the property key to partition by
151- * @param { GraphTraversal } [ options.edges] the value of the currently write partition
152- * @param { GraphTraversal } [ options.vertexProperties] list of strings representing the partitions to include for reads
153- * @param { boolean } [ options.checkAdjacentVertices] enables the strategy to apply the { @code vertices} filter to the adjacent vertices of an edge.
153+ * @param options
154+ * @param options.vertices - traversal to filter vertices
155+ * @param options.edges - traversal to filter edges
156+ * @param options.vertexProperties - traversal to filter vertex properties
157+ * @param options.checkAdjacentVertices - enables the strategy to apply the ` vertices` filter to the adjacent vertices of an edge.
154158 */
155- constructor ( options : TraversalStrategyConfiguration ) {
156- super ( options ) ;
157- if ( this . configuration . vertices instanceof Traversal ) {
158- this . configuration . vertices = this . configuration . vertices . gremlinLang ;
159- }
160- if ( this . configuration . edges instanceof Traversal ) {
161- this . configuration . edges = this . configuration . edges . gremlinLang ;
162- }
163- if ( this . configuration . vertexProperties instanceof Traversal ) {
164- this . configuration . vertexProperties = this . configuration . vertexProperties . gremlinLang ;
165- }
159+ constructor ( { vertices, edges, vertexProperties, checkAdjacentVertices} : { vertices ?: any , edges ?: any , vertexProperties ?: any , checkAdjacentVertices ?: boolean } = { } ) {
160+ const config : Record < string , any > = { } ;
161+ if ( vertices !== undefined ) config . vertices = vertices instanceof Traversal ? vertices . gremlinLang : vertices ;
162+ if ( edges !== undefined ) config . edges = edges instanceof Traversal ? edges . gremlinLang : edges ;
163+ if ( vertexProperties !== undefined ) config . vertexProperties = vertexProperties instanceof Traversal ? vertexProperties . gremlinLang : vertexProperties ;
164+ if ( checkAdjacentVertices !== undefined ) config . checkAdjacentVertices = checkAdjacentVertices ;
165+ super ( config ) ;
166166 }
167167}
168168
169169export class ProductiveByStrategy extends TraversalStrategy {
170170 /**
171- * @param { Object } [ options]
172- * @param { Array<String> } [ options.productiveKeys] set of keys that will always be productive
171+ * @param options
172+ * @param options.productiveKeys - set of keys that will always be productive
173173 */
174- constructor ( options : TraversalStrategyConfiguration ) {
175- super ( options ) ;
174+ constructor ( { productiveKeys = [ ] } = { } ) {
175+ super ( { productiveKeys } ) ;
176176 }
177177}
178178
@@ -313,8 +313,9 @@ export class ReadOnlyStrategy extends TraversalStrategy {
313313
314314export class EdgeLabelVerificationStrategy extends TraversalStrategy {
315315 /**
316- * @param {boolean } logWarnings determines if warnings should be written to the logger when verification fails
317- * @param {boolean } throwException determines if exceptions should be thrown when verifications fails
316+ * @param options
317+ * @param options.logWarnings - determines if warnings should be written to the logger when verification fails
318+ * @param options.throwException - determines if exceptions should be thrown when verifications fails
318319 */
319320 constructor ( { logWarnings = false , throwException = false } = { } ) {
320321 super ( {
@@ -326,9 +327,10 @@ export class EdgeLabelVerificationStrategy extends TraversalStrategy {
326327
327328export class ReservedKeysVerificationStrategy extends TraversalStrategy {
328329 /**
329- * @param {boolean } logWarnings determines if warnings should be written to the logger when verification fails
330- * @param {boolean } throwException determines if exceptions should be thrown when verifications fails
331- * @param {Array<String> } keys the list of reserved keys to verify
330+ * @param options
331+ * @param options.logWarnings - determines if warnings should be written to the logger when verification fails
332+ * @param options.throwException - determines if exceptions should be thrown when verifications fails
333+ * @param options.keys - the list of reserved keys to verify
332334 */
333335 constructor ( { logWarnings = false , throwException = false , keys = [ 'id' , 'label' ] } = { } ) {
334336 super ( {
0 commit comments