private static boolean hasArrayFields(TypeDef item) { return item.getMethods() .stream() .filter(m -> m.getReturnType() instanceof ClassRef && ((ClassRef)m.getReturnType()).getDimensions() > 0) .findAny().isPresent(); }
/** * Checks if a {@link TypeRef} is an array. * @param type The type to check. * @return True if its an array.B */ public static boolean isArray(TypeRef type) { if (type instanceof ClassRef) { return ((ClassRef)type).getDimensions() > 0; } else if (type instanceof PrimitiveRef) { return ((PrimitiveRef)type).getDimensions() > 0; } else if (type instanceof TypeParamRef) { return ((TypeParamRef)type).getDimensions() > 0; } else { return false; } }
public ClassRefFluentImpl(ClassRef instance){ this.withDefinition(instance.getDefinition()); this.withFullyQualifiedName(instance.getFullyQualifiedName()); this.withDimensions(instance.getDimensions()); this.withArguments(instance.getArguments()); this.withAttributes(instance.getAttributes()); }
public ClassRefBuilder(ClassRefFluent<?> fluent, ClassRef instance, Boolean validationEnabled) { this.fluent = fluent; fluent.withDefinition(instance.getDefinition()); fluent.withFullyQualifiedName(instance.getFullyQualifiedName()); fluent.withDimensions(instance.getDimensions()); fluent.withArguments(instance.getArguments()); fluent.withAttributes(instance.getAttributes()); this.validationEnabled = validationEnabled; }
public ClassRefBuilder(ClassRef instance, Boolean validationEnabled) { this.fluent = this; this.withDefinition(instance.getDefinition()); this.withFullyQualifiedName(instance.getFullyQualifiedName()); this.withDimensions(instance.getDimensions()); this.withArguments(instance.getArguments()); this.withAttributes(instance.getAttributes()); this.validationEnabled = validationEnabled; }
.withDimensions(ref.getDimensions()) .build(); item.getMethods() .stream() .filter(m -> m.getReturnType() instanceof ClassRef && ((ClassRef)m.getReturnType()).getDimensions() > 0) .findAny().ifPresent(m -> { additionalImports.add(ARRAYS);