Example usage for java.lang Void TYPE

List of usage examples for java.lang Void TYPE

Introduction

In this page you can find the example usage for java.lang Void TYPE.

Prototype

Class TYPE

To view the source code for java.lang Void TYPE.

Click Source Link

Document

The Class object representing the pseudo-type corresponding to the keyword void .

Usage

From source file:springfox.documentation.schema.ModelReferenceProvider.java

private ModelReference modelReference(ResolvedType type) {
    if (Void.class.equals(type.getErasedType()) || Void.TYPE.equals(type.getErasedType())) {
        return new ModelRef("void");
    }//  w  w w  . j  a v  a  2  s  .  c  om
    if (MultipartFile.class.isAssignableFrom(type.getErasedType())) {
        return new ModelRef("File");
    }
    String typeName = typeNameExtractor.typeName(fromParent(parentContext, type));
    return new ModelRef(typeName, allowableValues(type));
}

From source file:org.lunarray.model.descriptor.builder.annotation.resolver.matchers.AccessorMatcher.java

/** {@inheritDoc} */
@Override/*from  w  w  w.j ava2 s  . c o m*/
protected boolean matchConditions(final Method memberType) {
    Validate.notNull(memberType, AccessorMatcher.METHOD_NULL);
    return (memberType.getParameterTypes().length == 0) && !Void.TYPE.equals(memberType.getReturnType());
}

From source file:griffon.plugins.domain.methods.MethodSignature.java

public MethodSignature(boolean isStatic, @Nonnull String methodName) {
    this(isStatic, Void.TYPE, methodName, EMPTY_CLASS_ARRAY);
}

From source file:springfox.documentation.builders.AlternateTypePropertyBuilder.java

private DynamicType.Builder<Object> setter(DynamicType.Builder<Object> builder) {
    return builder.defineMethod("set" + capitalize(name), Void.TYPE, Visibility.PUBLIC).withParameters(clazz)
            .intercept(FieldAccessor.ofField(name));
}

From source file:org.apache.camel.impl.converter.FutureTypeConverter.java

@SuppressWarnings("unchecked")
private <T> T doConvertTo(Class<T> type, Exchange exchange, Object value) throws Exception {
    // do not convert to stream cache
    if (StreamCache.class.isAssignableFrom(value.getClass())) {
        return null;
    }// w  w  w .j a  va  2 s  . c  om

    if (Future.class.isAssignableFrom(value.getClass())) {

        Future future = (Future) value;

        if (future.isCancelled()) {
            // return void to indicate its not possible to convert at this time
            return (T) Void.TYPE;
        }

        // do some trace logging as the get is blocking until the response is ready
        if (LOG.isTraceEnabled()) {
            LOG.trace("Getting future response");
        }

        Object body = future.get();
        if (LOG.isTraceEnabled()) {
            LOG.trace("Got future response");
        }

        if (body == null) {
            // return void to indicate its not possible to convert at this time
            return (T) Void.TYPE;
        }

        // maybe from is already the type we want
        if (type.isAssignableFrom(body.getClass())) {
            return type.cast(body);
        } else if (body instanceof Exchange) {
            Exchange result = (Exchange) body;
            body = ExchangeHelper.extractResultBody(result, result.getPattern());
        }

        // no then try to lookup a type converter
        return converter.convertTo(type, exchange, body);
    }

    return null;
}

From source file:griffon.plugins.domain.methods.MethodSignature.java

public MethodSignature(boolean isStatic, @Nonnull String methodName, Class<?>... parameterTypes) {
    this(isStatic, Void.TYPE, methodName, parameterTypes);
}

From source file:org.apache.camel.util.IntrospectionSupport.java

public static boolean isGetter(Method method) {
    String name = method.getName();
    Class<?> type = method.getReturnType();
    Class<?> params[] = method.getParameterTypes();

    if (!GETTER_PATTERN.matcher(name).matches()) {
        return false;
    }//w  w  w . ja  v  a2 s. c  o  m

    // special for isXXX boolean
    if (name.startsWith("is")) {
        return params.length == 0 && type.getSimpleName().equalsIgnoreCase("boolean");
    }

    return params.length == 0 && !type.equals(Void.TYPE);
}

From source file:org.psnively.scala.beans.ScalaBeanInfo.java

private static boolean isScalaGetter(Method method) {
    return method.getParameterTypes().length == 0 && !method.getReturnType().equals(Void.TYPE)
            && !(method.getName().startsWith("get") || method.getName().startsWith("is"));
}

From source file:springfox.documentation.spring.web.readers.operation.HandlerMethodResolver.java

public ResolvedType methodReturnType(HandlerMethod handlerMethod) {
    return resolvedMethod(handlerMethod).transform(toReturnType(typeResolver))
            .or(typeResolver.resolve(Void.TYPE));
}

From source file:org.psnively.scala.beans.ScalaBeanInfo.java

public static boolean isScalaSetter(Method method) {
    return method.getParameterTypes().length == 1 && method.getReturnType().equals(Void.TYPE)
            && method.getName().endsWith(SCALA_SETTER_SUFFIX);
}