package com.cyrilpillai.compiler.util;

import com.squareup.javapoet.AnnotationSpec;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

import javax.annotation.Generated;

public final class BaseUtil {

    public static AnnotationSpec getGenerationDetails(Class className) {
        DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.ENGLISH);
        return AnnotationSpec.builder(Generated.class)
                .addMember("value", "$S", className.getCanonicalName())
                .addMember("date", "$S", dateFormat.format(new Date()))
                .addMember("comments", "$S", "Auto Generated by GreenDAO Migrator. DO NOT EDIT.")
                .build();
    }
}