Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gastaldi/annotation-builder

Creates an annotation instance using a fluent configuration
https://github.com/gastaldi/annotation-builder

Last synced: 2 days ago
JSON representation

Creates an annotation instance using a fluent configuration

Awesome Lists containing this project

README

        

Suppose you have an annotation like:

public @interface MyAnnotation {
String aStringValue();
boolean aBooleanValue();
}

You may use AnnotationBuilder to configure a new instance for it:

AnnotationBuilder builder = AnnotationBuilder.create(MyAnnotation.class);
MyAnnotation mockAnn = builder.toMock(MyAnnotation.class);

builder.configure(mockAnn.aStringValue()).with("Some value");
builder.configure(mockAnn.aBooleanValue()).with(true);

//This is your instance annotation
MyAnnotation annInstance = builder.toAnnotation();