
com.mangofactory.swagger.models.dto.OAuth Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of swagger-models Show documentation
Show all versions of swagger-models Show documentation
This project integrates swagger with the Spring Web MVC framework
The newest version!
package com.mangofactory.swagger.models.dto;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
public class OAuth extends AuthorizationType {
private final List scopes;
private final LinkedHashMap grantTypes;
public OAuth(List scopes, List gTypes) {
super("oauth2");
this.scopes = scopes;
this.grantTypes = initializeGrantTypes(gTypes);
}
private LinkedHashMap initializeGrantTypes(List gTypes) {
if (null != gTypes) {
LinkedHashMap map = new LinkedHashMap();
for (GrantType grantType : gTypes) {
map.put(grantType.getType(), grantType);
}
return map;
}
return null;
}
@Override
public String getName() {
return super.type;
}
public List getScopes() {
return scopes;
}
public List getGrantTypes() {
return new ArrayList(grantTypes.values());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy