io.gsonfire.gson.FireExclusionStrategyComposite Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gson-fire Show documentation
Show all versions of gson-fire Show documentation
A java library that adds some very useful features to Gson, like Date serializing to unix timestamp or RFC3339, method (getter) serialization, pre and post processors and many more. Check out the documentation to learn how to use it!
package io.gsonfire.gson;
import io.gsonfire.postprocessors.methodinvoker.MappedMethod;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
/**
* Created by julio on 5/25/15.
*/
public final class FireExclusionStrategyComposite implements FireExclusionStrategy {
private final Collection strategies;
public FireExclusionStrategyComposite(FireExclusionStrategy... strategies) {
this(Arrays.asList(strategies));
}
public FireExclusionStrategyComposite(Collection strategies) {
this.strategies = new ArrayList(strategies);
}
@Override
public boolean shouldSkipMethod(MappedMethod method) {
for(FireExclusionStrategy strategy: strategies) {
if(strategy.shouldSkipMethod(method)) {
return true;
}
}
return false;
}
}