2626import java .util .TreeMap ;
2727import java .util .function .BiConsumer ;
2828
29- public class HashValue implements ValueNode , Multipart {
29+ public class HashValue implements ValueNode , Formdata {
3030 private static final Map <String , ValueNode > EMPTY = Collections .emptyMap ();
3131
3232 private Context ctx ;
@@ -49,15 +49,15 @@ protected HashValue(Context ctx) {
4949 return name ;
5050 }
5151
52- public Formdata put (String path , String value ) {
53- return put (path , Collections .singletonList (value ));
52+ public void put (String path , String value ) {
53+ put (path , Collections .singletonList (value ));
5454 }
5555
56- public HashValue put (String path , ValueNode upload ) {
56+ public void put (String path , ValueNode node ) {
5757 put (path , (name , scope ) -> {
5858 ValueNode existing = scope .get (name );
5959 if (existing == null ) {
60- scope .put (name , upload );
60+ scope .put (name , node );
6161 } else {
6262 ArrayValue list ;
6363 if (existing instanceof ArrayValue ) {
@@ -66,13 +66,12 @@ public HashValue put(String path, ValueNode upload) {
6666 list = new ArrayValue (ctx , name ).add (existing );
6767 scope .put (name , list );
6868 }
69- list .add (upload );
69+ list .add (node );
7070 }
7171 });
72- return this ;
7372 }
7473
75- public HashValue put (String path , Collection <String > values ) {
74+ public void put (String path , Collection <String > values ) {
7675 put (path , (name , scope ) -> {
7776 for (String value : values ) {
7877 ValueNode existing = scope .get (name );
@@ -90,7 +89,6 @@ public HashValue put(String path, Collection<String> values) {
9089 }
9190 }
9291 });
93- return this ;
9492 }
9593
9694 private void put (String path , BiConsumer <String , Map <String , ValueNode >> consumer ) {
@@ -233,11 +231,9 @@ public int size() {
233231 String scope = name == null ? "" : name + "." ;
234232 for (Map .Entry <String , ValueNode > entry : entries ) {
235233 ValueNode value = entry .getValue ();
236- if (!value .isUpload ()) {
237- value .toMultimap ().forEach ((k , v ) -> {
238- result .put (scope + k , v );
239- });
240- }
234+ value .toMultimap ().forEach ((k , v ) -> {
235+ result .put (scope + k , v );
236+ });
241237 }
242238 return result ;
243239 }
@@ -246,11 +242,10 @@ public int size() {
246242 return hash .toString ();
247243 }
248244
249- public HashValue put (Map <String , Collection <String >> headers ) {
245+ public void put (Map <String , Collection <String >> headers ) {
250246 for (Map .Entry <String , Collection <String >> entry : headers .entrySet ()) {
251247 put (entry .getKey (), entry .getValue ());
252248 }
253- return this ;
254249 }
255250
256251 private <T , C extends Collection <T >> C toCollection (@ Nonnull Class <T > type , C collection ) {
0 commit comments