private ContentModel contentModel() { return typeInfo.hasAnnotation(Void.class) ? ContentModel.VOID : ContentModel.NON_VOID; }
@Override public boolean test(Property property) { return property.returnTypeInfo() .typeInfo() .map(typeInfo -> typeInfo.hasAnnotation(type)) .orElse(Boolean.FALSE) .booleanValue(); }
@Override public boolean test(Property property) { return property.returnTypeInfo() .typeInfo() .map(typeInfo -> typeInfo.hasAnnotation(type)) .orElse(Boolean.FALSE) .booleanValue(); }
Stream<ProtoTypeType> protoTypeStream() { return packageInfo.declaredTypeInfoStream() .flatMap(TypeInfo::declaredTypeInfoStream) .filter(type -> type.hasAnnotation(ProtoType.class)) .map(ProtoTypeType::of) .sorted((t1, t2) -> t1.tagName().compareTo(t2.tagName())); }
public static <T> Optional<T> of(MethodInfo methodInfo, Constructor<T> constructor) { if (!methodInfo.hasModifierInfo(ModifierInfo.ABSTRACT)) { methodInfo.compilationError("@Query method must be abstract"); return Optional.empty(); } if (methodInfo.hasAccessInfo(AccessInfo.PRIVATE)) { methodInfo.compilationError("@Query must not be private"); return Optional.empty(); } SimpleTypeInfo returnTypeInfo = methodInfo.returnTypeInfo(); QueryReturnType returnType = QueryReturnType.of(returnTypeInfo); TypeInfo pojoTypeInfo = returnType.pojoTypeInfo(returnTypeInfo); if (!pojoTypeInfo.hasAnnotation(Pojo.class)) { methodInfo.compilationError("@Query must return a List of, an Optional of or an instance of a @Pojo."); return Optional.empty(); } T method = constructor.apply(methodInfo, returnType, pojoTypeInfo); return Optional.of(method); }
public static ColumnInfoTypeInfo of(TableName tableName, TypeInfo typeInfo) { return ColumnInfoTypeInfo.builder() .tableName(tableName) .simpleName(stringValue(typeInfo, ColumnName.class)) .nullable(typeInfo.hasAnnotation(Nullable.class)) .generationInfo(OrmGenerationInfo.of(typeInfo)) .simpleTypeInfo(typeInfo.toSimpleTypeInfo()) .build(); }