
com.activitystream.helpers.MapCreator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk Show documentation
Show all versions of sdk Show documentation
For a description please see https://github.com/activitystream/as-sdk-java
package com.activitystream.helpers;
import com.activitystream.underware.Factories;
import java.util.Map;
public class MapCreator {
Map backend = Factories.getMap();
private void add(KVPair pair) {
backend.put(pair.key, pair.value);
}
public KVPair key(K key) {
return new KVPair(key, this);
}
public Map map() {return backend;}
public class KVPair {
private K key;
private MapCreator owner;
private V value;
public KVPair(K key, MapCreator owner) {
this.key = key;
this.owner = owner;
}
public MapCreator value(V value) {
this.value = value;
owner.add(this);
return owner;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy