public static GremlinQueryBuilder ValueMap(this GremlinQueryBuilder builder, GremlinParameter parameter) { // this function can only take true or false if (parameter == null) { throw new ArgumentNullException(nameof(parameter)); } if (!bool.TryParse(parameter.Value, out _)) { throw new GremlinQueryBuilderException( $"{nameof(ValueMap)} only supports boolean parameters and '{parameter.Value}' does not appear to be"); } return(builder.Add($"valueMap({parameter.Value})")); }
/// <summary> /// To specify a constant value for a traverser, use the constant()-step (map). /// This is often useful with conditional steps like choose()-step or coalesce()-step /// </summary> /// <param name="builder"></param> /// <param name="parameter"></param> /// <returns></returns> /// <exception cref="ArgumentNullException"></exception> public static GremlinQueryBuilder Constant(this GremlinQueryBuilder builder, GremlinParameter parameter) { // for implicit conversion operators return(builder.Constant((IGremlinParameter)parameter)); }
/// <summary> /// Predicate that checks if the incoming number is greater than or equal /// to the first provided number and less than the second /// </summary> /// <param name="builder"></param> /// <param name="start"></param> /// <param name="end"></param> /// <returns></returns> /// <exception cref="ArgumentNullException"></exception> /// <exception cref="GremlinQueryBuilderException"></exception> public static GremlinQueryBuilder Between(this GremlinQueryBuilder builder, GremlinParameter start, GremlinParameter end) { // for implicit conversion operators return(builder.Between((IGremlinParameter)start, (IGremlinParameter)end)); }
// for implicit conversion operators public static GremlinQueryBuilder To(this GremlinQueryBuilder builder, GremlinParameter parameter) { return(builder.To((IGremlinParameter)parameter)); }
/// <summary> /// Remove the traverser if its element does not have any of the ids /// </summary> /// <param name="builder"></param> /// <param name="parameter"></param> /// <returns></returns> public static GremlinQueryBuilder HasId(this GremlinQueryBuilder builder, GremlinParameter parameter) { // for implicit conversion operators with common single id use return(builder.HasId((IGremlinParameter)parameter)); }
// for implicit conversion operators public static GremlinQueryBuilder Aggregate(this GremlinQueryBuilder builder, GremlinParameter parameter) { return(builder.Aggregate((IGremlinParameter)parameter)); }
// for implicit conversion operators public static GremlinQueryBuilder Constant(this GremlinQueryBuilder builder, GremlinParameter parameter) { return(builder.Constant((IGremlinParameter)parameter)); }
// for implicit conversion operators public static GremlinQueryBuilder HasLabel(this GremlinQueryBuilder builder, GremlinParameter parameter) { return(builder.HasLabel((IGremlinParameter)parameter)); }
/// <summary> /// Inject vertices into traversal. Can filter by specified vertex ids. /// </summary> /// <param name="builder"></param> /// <param name="parameter"></param> /// <returns></returns> public static GremlinQueryBuilder V(this GremlinQueryBuilder builder, GremlinParameter parameter) { // common single id selection scenario for implicit conversion operators return(builder.V((IGremlinParameter)parameter)); }