package com.tutego.insel.annotation;

import static java.lang.System.out;

import java.lang.annotation.Annotation;
import java.util.Arrays;

public class ReadAnnotations
{
  static void printAttributeValues( Class<?> clazz )
  {
    for ( Annotation a : clazz.getAnnotations() )
      if ( a instanceof Optimize )
      {
        Optimize oa = (Optimize) a;

        out.println( oa.value() );                       // Schneller!
        out.println( Arrays.toString(oa.assignedTo()) ); // [Christian]
        out.println( oa.priority() );                    // HIGH
      }
  }

  public static void main( String[] args )
  {
    printAttributeValues( DatabaseDAO.class );
    Optimize annotation = DatabaseDAO.class.getAnnotation(Optimize.class);
    System.out.println( annotation.value() );
  }
}
