Create a new SmartBinder from the given types and argument names.

@param retType the type of the return value to start with
@param names   the names of arguments
@param types   the argument types
@return a new SmartBinder
420386
public static SmartBinder from(Class<?> retType, String[] names, Class<?>... types) {
        return from(Signature.returning(retType).appendArgs(names, types));
    }
664525
public static SmartBinder from(Signature inbound) {
        return new SmartBinder(inbound, Binder.from(inbound.type()));
    }
276266
public static <T> QBean<T> fields(Class<? extends T> type, Map<String, ? extends Expression<?>> bindings) {
        return new QBean<T>(type, true, bindings);
    }
630225
public TypeBindings withUnboundVariable(String name)
    {
        int len = (_unboundVariables == null) ? 0 : _unboundVariables.length;
        String[] names =  (len == 0)
                ? new String[1] : Arrays.copyOf(_unboundVariables, len+1);
        names[len] = name;
        return new TypeBindings(_names, _types, names);
    }
449307
public static <E, M extends BinderMapper<E>> M mapperFor(ParameterizedType type) throws NoSuchMapperException {
		@SuppressWarnings("unchecked")
		M mapper = AbstractContext.getMapper((Class<E>) type.getActualTypeArguments()[0]);
		if (mapper == null) {
			throw new NoSuchMapperException(type.getRawType());
		} else {
			return mapper;
		}
	}
1106026
public void setBindings( Collection<VarBindingDef> bindings)
    {
    bindings_ = new HashMap<VarDef,VarBindingDef>();
    properties_ = new PropertySet();
    
    if( bindings != null)
      {
      for( VarBindingDef binding : bindings)
        {
        add( binding);
        }
      }
    }
1174231
private <T> Set<? extends T> create(Iterable<Class<? extends T>> types)
	{
		Set<T> result = new HashSet<>();

		for(Class<? extends T> t : types)
		{
			if(! Modifier.isAbstract(t.getModifiers()) && ! t.isInterface())
			{
				T instance = factory.create(t);
				result.add(instance);
			}
		}

		return Collections.unmodifiableSet(result);
	}
1176060
public static <T> QBean<T> bean(Class<? extends T> type, Map<String, ? extends Expression<?>> bindings) {
        return new QBean<T>(type, bindings);
    }
985537
public static <K, V> GinMapBinder<K, V> newMapBinder(
      GinBinder binder, Class<K> keyType, Class<V> valueType) {
    return newMapBinder(binder, TypeLiteral.get(keyType), TypeLiteral.get(valueType));
  }
133157
@SuppressWarnings("unchecked")
  public <S, D> TypeMap<S, D> get(Class<S> sourceType, Class<D> destinationType, String typeMapName) {
    TypeMap<S, D> typeMap = (TypeMap<S, D>) typeMaps.get(TypePair.of(sourceType, destinationType, typeMapName));
    if (typeMap != null)
      return typeMap;

    for (TypePair<?, ?> typePair : getPrimitiveWrapperTypePairs(sourceType, destinationType, typeMapName)) {
      typeMap = (TypeMap<S, D>) typeMaps.get(typePair);
      if (typeMap != null)
        return typeMap;
    }

    return null;
  }
805471
private <T> MapperWrapper<T> createMappingChain(JavaType type) {
		return new MapperWrapper<T>(type, this.mapper, this.createUnmappedChain());
	}
1368970
public SmartBinder spread(String[] spreadNames, Class<?>... spreadTypes) {
        return new SmartBinder(this, signature().spread(spreadNames, spreadTypes), binder.spread(spreadTypes));
    }
830557
public static <T> SerializerBinderBuilder<T> builderOf(Binder binder, final Class<T> type) {
        return new SerializerBinderBuilderImpl<T> (binder, new TypeReference<T>() {
            @Override
            public Type getType() {
                return type;
            }
        });
    }
433633
public List<Class<?>> getRawTypes(List<DomainObjectType> types) {
		List<Class<?>> resultList = new ArrayList<Class<?>>();
		for (DomainObjectType type : types) {
			resultList.add(type.getType());
		}
		return resultList;
	}
887479
public static <T> Key<T> of(Type type, Class<? extends Annotation> []annTypes)
  {
    return new Key<>(type, annTypes);
  }
650399
protected Map<String, Object> resolveGenericTypes(TypeMirror type, Map<String, Object> boundTypes) {
        if (type.getKind().isPrimitive() || type.getKind() == VOID || type.getKind() == ARRAY) {
            return Collections.emptyMap();
        }
        if (type instanceof DeclaredType) {
            DeclaredType declaredType = (DeclaredType) type;
            return resolveGenericTypes(declaredType, (TypeElement) declaredType.asElement(), boundTypes);
        } else if (type instanceof TypeVariable) {
            TypeVariable var = (TypeVariable) type;
            TypeMirror upperBound = var.getUpperBound();
            if (upperBound instanceof DeclaredType) {
                return resolveGenericTypes(upperBound, boundTypes);
            }
        }
        return Collections.emptyMap();
    }
1076488
public String getBindMapperName(BindTypeContext context, TypeName typeName) {
		Converter<String, String> format = CaseFormat.UPPER_CAMEL.converterTo(CaseFormat.LOWER_CAMEL);
		TypeName bindMapperName=TypeUtility.mergeTypeNameWithSuffix(typeName,BindTypeBuilder.SUFFIX);
		String simpleName=format.convert(TypeUtility.simpleName(bindMapperName));
	
		if (!alreadyGeneratedMethods.contains(simpleName))
		{
			alreadyGeneratedMethods.add(simpleName);
			if (bindMapperName.equals(beanTypeName))
			{
				context.builder.addField(FieldSpec.builder(bindMapperName, simpleName, modifiers)					
						.addJavadoc("$T", bindMapperName)
						.initializer("this")
						.build());
			} else {				
				context.builder.addField(FieldSpec.builder(bindMapperName, simpleName, modifiers)					
						.addJavadoc("$T", bindMapperName)
						.initializer("$T.mapperFor($T.class)", BinderUtils.class, typeName)
						.build());	
			}		
		}
		
		return simpleName;
	}