All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.gsonfire.gson.FireExclusionStrategyComposite Maven / Gradle / Ivy

Go to download

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!

There is a newer version: 1.9.0
Show newest version
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;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy