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

com.mangofactory.swagger.models.dto.OAuth Maven / Gradle / Ivy

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