/*
 * Copyright 2015 Michael Rozumyanskiy
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.michaelrocks.lightsaber.processor.annotations;

import org.objectweb.asm.Type;

import java.util.Collections;
import java.util.Map;

class AnnotationHelper {
    public static AnnotationDescriptor createAnnotation(final String annotationName) {
        return new AnnotationDescriptor(getAnnotationType(annotationName), Collections.<String, Object>emptyMap(), false);
    }

    public static AnnotationDescriptor createAnnotation(final String annotationName, final Object defaultValue) {
        return createAnnotation(annotationName, "value", defaultValue);
    }

    public static AnnotationDescriptor createAnnotation(final String annotationName, final String methodName,
            final Object defaultValue) {
        return createAnnotation(annotationName, Collections.singletonMap(methodName, defaultValue));
    }

    public static AnnotationDescriptor createAnnotation(final String annotationName,
            final Map<String, Object> values) {
        return new AnnotationDescriptor(getAnnotationType(annotationName), values, false);
    }

    public static Type getAnnotationType(final String annotationName) {
        return Type.getObjectType(annotationName);
    }
}

@@ -657,16 +657,60 @@
 tions;%0A%0A
+import org.apache.commons.lang3.tuple.Pair;%0A
 import o
@@ -763,16 +763,42 @@
 ctions;%0A
+import java.util.HashMap;%0A
 import j
@@ -1514,356 +1514,2118 @@
     
-public static AnnotationDescriptor createAnnotation(final String annotationName,%0A            final Map%3CString, Object%3E values) %7B%0A        return new AnnotationDescriptor(getAnnotationType(annotationName), values, false);%0A    %7D%0A%0A    public static Type getAnnotationType(final String annotationName) %7B%0A        return Type.getObjectType(annotationName)
+@SafeVarargs%0A    public static AnnotationDescriptor createAnnotation(final String annotationName,%0A            final Pair%3CString, ?%3E... values) %7B%0A        return new AnnotationDescriptor(getAnnotationType(annotationName), pairsToMap(values), false);%0A    %7D%0A%0A    public static AnnotationDescriptor createAnnotation(final String annotationName,%0A            final Map%3CString, Object%3E values) %7B%0A        return new AnnotationDescriptor(getAnnotationType(annotationName), values, false);%0A    %7D%0A%0A    public static AnnotationDescriptor createResolvedAnnotation(final String annotationName) %7B%0A        return new AnnotationDescriptor(getAnnotationType(annotationName), Collections.%3CString, Object%3EemptyMap(), true);%0A    %7D%0A%0A    public static AnnotationDescriptor createResolvedAnnotation(final String annotationName, final Object defaultValue) %7B%0A        return createResolvedAnnotation(annotationName, %22value%22, defaultValue);%0A    %7D%0A%0A    public static AnnotationDescriptor createResolvedAnnotation(final String annotationName, final String methodName,%0A            final Object defaultValue) %7B%0A        return createResolvedAnnotation(annotationName, Collections.singletonMap(methodName, defaultValue));%0A    %7D%0A%0A    @SafeVarargs%0A    public static AnnotationDescriptor createResolvedAnnotation(final String annotationName,%0A            final Pair%3CString, ?%3E... values) %7B%0A        return new AnnotationDescriptor(getAnnotationType(annotationName), pairsToMap(values), false);%0A    %7D%0A%0A    public static AnnotationDescriptor createResolvedAnnotation(final String annotationName,%0A            final Map%3CString, Object%3E values) %7B%0A        return new AnnotationDescriptor(getAnnotationType(annotationName), values, true);%0A    %7D%0A%0A    public static Type getAnnotationType(final String annotationName) %7B%0A        return Type.getObjectType(annotationName);%0A    %7D%0A%0A    private static Map%3CString, Object%3E pairsToMap(final Pair%3CString, ?%3E%5B%5D pairs) %7B%0A        final Map%3CString, Object%3E values = new HashMap%3C%3E();%0A        for (final Pair%3CString, ?%3E pair : pairs) %7B%0A            values.put(pair.getKey(), pair.getValue());%0A        %7D%0A        return values
 ;%0A  

Add more helper methods to AnnotationHelper