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

org.entur.jwt.spring.auth0.properties.MatcherConfiguration Maven / Gradle / Ivy

package org.entur.jwt.spring.auth0.properties;

import java.util.ArrayList;
import java.util.List;

public class MatcherConfiguration {

    private boolean enabled = true;

    private MethodMatcherConfiguration method = new MethodMatcherConfiguration();

    private List patterns = new ArrayList<>();

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }
    
    public boolean isEnabled() {
        return enabled;
    }
    
    public void setPatterns(List patterns) {
        this.patterns = patterns;
    }
    
    public List getPatterns() {
        return patterns;
    }
    
    public void setMethod(MethodMatcherConfiguration httpMethod) {
        this.method = httpMethod;
    }
    
    public MethodMatcherConfiguration getMethod() {
        return method;
    }
    
    public String[] getPatternsAsArray() {
        return patterns.toArray(new String[patterns.size()]);
    }

    public boolean isActive() {
        return enabled && (!patterns.isEmpty() || method.isActive());
    }

    public boolean hasPatterns() {
        return !patterns.isEmpty();
    }
    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy