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

org.yuequan.watchdog.endpoint.support.ApplicationParam Maven / Gradle / Ivy

There is a newer version: 0.8.3.BETA
Show newest version
package org.yuequan.watchdog.endpoint.support;

import java.util.HashSet;
import java.util.Set;

/**
 * @author yuequan
 * @since
 **/


public class ApplicationParam {
    private String name;
    private Set scope;

    public final static String DEFAULT_REDIRECT_URL = "urn:ietf:wg:oauth:2.0:oob";

    @org.codehaus.jackson.annotate.JsonProperty("redirect_uri")
    @com.fasterxml.jackson.annotation.JsonProperty("redirect_uri")
    private Set redirectUri;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Set getRedirectUri() {
        return redirectUri;
    }

    public void setRedirectUri(Set redirectUri) {
        this.redirectUri = redirectUri;
    }

    public Set getScope() {
        return scope;
    }

    public void setScope(Set scope) {
        this.scope = scope;
    }


    public void populateDefault(){
        if(getScope() == null){
            setScope(new HashSet<>());
        }

        if(getRedirectUri() == null){
            setRedirectUri(new HashSet<>());
        }

        if(this.getRedirectUri().size() == 0){
            getRedirectUri().add(DEFAULT_REDIRECT_URL);
        }

        if(getScope().size() == 0){
            getScope().add("DEFAULT");
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy