com.github.thomasridd.flatsy.operations.operators.UriToMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Flatsy Show documentation
Show all versions of Flatsy Show documentation
A library for handling flat file json databases
package com.github.thomasridd.flatsy.operations.operators;
import com.github.thomasridd.flatsy.FlatsyObject;
import java.util.concurrent.ConcurrentMap;
/**
* Created by thomasridd on 18/08/15.
*
* Migrate
*
* Copies the object and contents to a second FlatsyDatabase instance
*
* Use for backup, partial backup, or
*
*/
public class UriToMap implements FlatsyOperator {
ConcurrentMap map;
String value;
public UriToMap(ConcurrentMap map, String value) {
this.map = map;
this.value = value;
}
@Override
public void apply(FlatsyObject object) {
map.put(object.uri.toString(), value);
}
}