org.javers.guava.GuavaAddOns Maven / Gradle / Ivy
package org.javers.guava;
import org.javers.common.collections.Sets;
import org.javers.core.ConditionalTypesPlugin;
import org.javers.core.JaversBuilder;
import org.javers.core.diff.appenders.PropertyChangeAppender;
import org.javers.core.metamodel.type.JaversType;
import java.util.Collection;
import java.util.Set;
/**
* @author akrystian
*/
public class GuavaAddOns extends ConditionalTypesPlugin {
@Override
public Collection>> getPropertyChangeAppenders(){
return (Set)Sets.asSet(MultisetChangeAppender.class, MultimapChangeAppender.class);
}
@Override
public Collection getNewTypes() {
return (Set)Sets.asSet(MultimapType.getInstance(),
MultisetType.getInstance());
}
@Override
public void beforeAssemble(JaversBuilder javersBuilder) {
javersBuilder.registerJsonAdvancedTypeAdapter(new MultimapTypeAdapter());
javersBuilder.registerJsonAdvancedTypeAdapter(new MultisetTypeAdapter());
}
}