Skip to content

Commit

Permalink
enhanced Parameters for upto 8 params
Browse files Browse the repository at this point in the history
  • Loading branch information
jlangch committed Oct 14, 2024
1 parent 7e71903 commit 3777805
Showing 1 changed file with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions src/main/java/com/github/jlangch/venice/Parameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,88 @@ public static Map<String,Object> of(
.toMap();
}

/**
* Returns a map containing a three mappings.
*
* @param key1 the first mapping's key
* @param val1 the first mapping's value
* @param key2 the second mapping's key
* @param val2 the second mapping's value
* @param key3 the third mapping's key
* @param val3 the third mapping's value
* @param key4 the fourth mapping's key
* @param val4 the fourth mapping's value
* @param key5 the fifth mapping's key
* @param val5 the fifth mapping's value
* @param key6 the sixth mapping's key
* @param val6 the sixth mapping's value
* @param key7 the sixth mapping's key
* @param val7 the sixth mapping's value
* @return a Map containing the specified mappings
*/
public static Map<String,Object> of(
final String key1, final Object val1,
final String key2, final Object val2,
final String key3, final Object val3,
final String key4, final Object val4,
final String key5, final Object val5,
final String key6, final Object val6,
final String key7, final Object val7
) {
return new Parameters()
.put(key1, val1)
.put(key2, val2)
.put(key3, val3)
.put(key4, val4)
.put(key5, val5)
.put(key6, val6)
.put(key7, val7)
.toMap();
}

/**
* Returns a map containing a three mappings.
*
* @param key1 the first mapping's key
* @param val1 the first mapping's value
* @param key2 the second mapping's key
* @param val2 the second mapping's value
* @param key3 the third mapping's key
* @param val3 the third mapping's value
* @param key4 the fourth mapping's key
* @param val4 the fourth mapping's value
* @param key5 the fifth mapping's key
* @param val5 the fifth mapping's value
* @param key6 the sixth mapping's key
* @param val6 the sixth mapping's value
* @param key7 the sixth mapping's key
* @param val7 the sixth mapping's value
* @param key8 the sixth mapping's key
* @param val8 the sixth mapping's value
* @return a Map containing the specified mappings
*/
public static Map<String,Object> of(
final String key1, final Object val1,
final String key2, final Object val2,
final String key3, final Object val3,
final String key4, final Object val4,
final String key5, final Object val5,
final String key6, final Object val6,
final String key7, final Object val7,
final String key8, final Object val8
) {
return new Parameters()
.put(key1, val1)
.put(key2, val2)
.put(key3, val3)
.put(key4, val4)
.put(key5, val5)
.put(key6, val6)
.put(key7, val7)
.put(key8, val8)
.toMap();
}

/**
* Fluent builder: add a single mapping.
*
Expand Down

0 comments on commit 3777805

Please sign in to comment.