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

gw.util.AnnotationUtil Maven / Gradle / Ivy

There is a newer version: 1.18.2
Show newest version
/*
 * Copyright 2014 Guidewire Software, Inc.
 */

package gw.util;

import gw.lang.reflect.IAnnotationInfo;
import gw.lang.reflect.IType;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class AnnotationUtil {
  public static Map> map(List annotations) {
    HashMap> map = new HashMap>();
    for (IAnnotationInfo annotation : annotations) {
      List infoList = map.get(annotation.getType());
      if (infoList == null) {
        infoList = new ArrayList();
        map.put(annotation.getType(), infoList);
      }
      infoList.add(annotation);
    }
    return map;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy