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

com.custardsource.parfait.spring.timing.BeanPredicates Maven / Gradle / Ivy

Go to download

Library enabling parfait timing collection around Spring beans using Spring AOP

There is a newer version: 0.3.11
Show newest version
package com.custardsource.parfait.spring.timing;

import com.google.common.base.Predicate;
import org.springframework.beans.factory.config.BeanDefinition;

public class BeanPredicates {
    public static Predicate hasAttribute(final String meta, final Object value) {
        return new Predicate() {
            @Override
            public boolean apply(BeanSpecification input) {
                BeanDefinition definition = input.getBeanFactory().getBeanDefinition(input.getName());
                Object attribute = definition.getAttribute(meta);
                return value.equals(attribute);
            }
        };
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy