X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffreenet%2FSimpleFieldSetBuilder.java;h=5507b0d4c9807f1657539a1f70a9b2e39a396a0a;hp=a596dcd8db1ec2075289ffdb395a4d8de2dcc821;hb=7086ff8446629c7e3d7acd73b1971205aea179f0;hpb=b96ed0c5e892e08a55bb02dc96680462b03b2aa0 diff --git a/src/main/java/net/pterodactylus/sone/freenet/SimpleFieldSetBuilder.java b/src/main/java/net/pterodactylus/sone/freenet/SimpleFieldSetBuilder.java index a596dcd..5507b0d 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/SimpleFieldSetBuilder.java +++ b/src/main/java/net/pterodactylus/sone/freenet/SimpleFieldSetBuilder.java @@ -1,5 +1,5 @@ /* - * Sone - SimpleFieldSetBuilder.java - Copyright © 2011 David Roden + * Sone - SimpleFieldSetBuilder.java - Copyright © 2011–2012 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -60,6 +60,19 @@ public class SimpleFieldSetBuilder { } /** + * Copies the given simple field set into the simple field set being built + * in this builder, overwriting all previously existing values. + * + * @param simpleFieldSet + * The simple field set to copy + * @return This simple field set builder + */ + public SimpleFieldSetBuilder put(SimpleFieldSet simpleFieldSet) { + this.simpleFieldSet.putAllOverwrite(simpleFieldSet); + return this; + } + + /** * Stores the given value under the given key, overwriting any previous * value. * @@ -89,4 +102,19 @@ public class SimpleFieldSetBuilder { return this; } + /** + * Stores the given value under the given key, overwriting any previous + * value. + * + * @param key + * The key of the value + * @param value + * The value to store + * @return This simple field set builder + */ + public SimpleFieldSetBuilder put(String key, long value) { + simpleFieldSet.put(key, value); + return this; + } + }