Search in sources :

Example 1 with CursorIterator

use of ru.curs.celesta.dbutils.CursorIterator in project celesta by CourseOrchestra.

the class CursorGenerator method buildIterator.

private static MethodSpec buildIterator(TypeName selfTypeName) {
    TypeName iteratorTypeName = ParameterizedTypeName.get(ClassName.get(Iterator.class), selfTypeName);
    TypeName cursorIterator = ParameterizedTypeName.get(ClassName.get(CursorIterator.class), selfTypeName);
    return MethodSpec.methodBuilder("iterator").addModifiers(Modifier.PUBLIC).addAnnotation(Override.class).returns(iteratorTypeName).addStatement("return new $T(this)", cursorIterator).build();
}
Also used : TypeName(com.squareup.javapoet.TypeName) WildcardTypeName(com.squareup.javapoet.WildcardTypeName) ParameterizedTypeName(com.squareup.javapoet.ParameterizedTypeName) ArrayTypeName(com.squareup.javapoet.ArrayTypeName) Iterator(java.util.Iterator) CursorIterator(ru.curs.celesta.dbutils.CursorIterator) CursorIterator(ru.curs.celesta.dbutils.CursorIterator)

Aggregations

ArrayTypeName (com.squareup.javapoet.ArrayTypeName)1 ParameterizedTypeName (com.squareup.javapoet.ParameterizedTypeName)1 TypeName (com.squareup.javapoet.TypeName)1 WildcardTypeName (com.squareup.javapoet.WildcardTypeName)1 Iterator (java.util.Iterator)1 CursorIterator (ru.curs.celesta.dbutils.CursorIterator)1