{@inheritDoc}

@see org.jboss.shrinkwrap.api.Assignable#as(java.lang.Class)
9860
@Override
    public <TYPE extends Assignable> TYPE as(final Class<TYPE> clazz) {
        return archive.as(clazz);
    }
8870
@SuppressWarnings("unchecked")
    static <T> Class<T> forClass(final String clsName, final boolean cacheResult) throws IllegalArgumentException {
        Class<?> cls = clsNamePool.get(clsName);

        if (cls == null) {
            cls = BUILT_IN_TYPE.get(clsName);

            if (cls == null) {
                try {
                    cls = Class.forName(clsName);
                } catch (ClassNotFoundException e) {
                    String newClassName = clsName;

                    if (newClassName.indexOf(WD._PERIOD) < 0) {
                        int index = newClassName.indexOf("[]");

                        if (((index < 0) && !SYMBOL_OF_PRIMITIVE_ARRAY_CLASS_NAME.containsKey(newClassName))
                                || ((index > 0) && !SYMBOL_OF_PRIMITIVE_ARRAY_CLASS_NAME.containsKey(newClassName.substring(0, index)))) {
                            newClassName = "java.lang." + newClassName;

                            try {
                                cls = Class.forName(newClassName);

                                BUILT_IN_TYPE.put(clsName, cls);
                            } catch (ClassNotFoundException e1) {
                                // ignore.
                            }
                        }
                    }

                    if (cls == null) {
                        newClassName = clsName;
                        int index = newClassName.indexOf("[]");

                        if (index > 0) {
                            String componentTypeName = newClassName.substring(0, index);
                            String temp = newClassName.replaceAll("\\[\\]", "");

                            if (componentTypeName.equals(temp)) {
                                int dimensions = (newClassName.length() - temp.length()) / 2;
                                String prefixOfArray = "";

                                while (dimensions-- > 0) {
                                    prefixOfArray += "[";
                                }

                                String symbolOfPrimitiveArraryClassName = SYMBOL_OF_PRIMITIVE_ARRAY_CLASS_NAME.get(componentTypeName);

                                if (symbolOfPrimitiveArraryClassName != null) {
                                    try {
                                        cls = Class.forName(prefixOfArray + symbolOfPrimitiveArraryClassName);

                                        BUILT_IN_TYPE.put(clsName, cls);
                                    } catch (ClassNotFoundException e2) {
                                        // ignore.
                                    }
                                } else {
                                    try {
                                        final Type<?> componentType = N.typeOf(componentTypeName);

                                        if (componentType.clazz().equals(Object.class) && !componentType.name().equals(ObjectType.OBJECT)) {
                                            throw new IllegalArgumentException("No Class found by name: " + clsName);
                                        }

                                        cls = Class.forName(prefixOfArray + "L" + componentType.clazz().getCanonicalName() + ";");
                                    } catch (ClassNotFoundException e3) {
                                        // ignore.
                                    }
                                }
                            }
                        }

                        if (cls == null) {
                            newClassName = clsName;
                            int lastIndex = -1;

                            while ((lastIndex = newClassName.lastIndexOf(WD._PERIOD)) > 0) {
                                newClassName = newClassName.substring(0, lastIndex) + "$" + newClassName.substring(lastIndex + 1);

                                try {
                                    cls = Class.forName(newClassName);
                                    break;
                                } catch (ClassNotFoundException e3) {
                                    // ignore.
                                }
                            }
                        }
                    }
                }
            }

            if (cls == null) {
                throw new IllegalArgumentException("No class found by name: " + clsName);
            }

            if (cacheResult) {
                clsNamePool.put(clsName, cls);
            }
        }

        return (Class<T>) cls;
    }
1201246
@Override
    public <T> T unwrap(Class<T> clazz) {
        return Request.class.isAssignableFrom(clazz) ?
                clazz.cast(request) :
                Out.class.isAssignableFrom(clazz) ?
                        clazz.cast(out) :
                        null;
    }
225913
@SuppressWarnings("unchecked")
    public static <T> T asType(File f, Class<T> c) {
        if (c == Writable.class) {
            return (T) asWritable(f);
        }
        return DefaultGroovyMethods.asType((Object) f, c);
    }
449388
public <T> T asObject(Class<T> type)
	{
		return config.asObject(key, type);
	}
876581
public static <E> Bindable<List<E>> listOf(Class<E> elementType) {
		return of(ResolvableType.forClassWithGenerics(List.class, elementType));
	}
745146
public static <T> T as(Object src, Class<T> type) {
        Class<?> t = type;
        while (t.isArray()) {
            t = t.getComponentType();
        }
        if (t == type) {
            // not an array at all
            return boxAs(src, type);
        } else {        
            if (t.isPrimitive()) {
                return deepUnboxAs(src, type);
            } else {
                return deepBoxAs(src, type);
            }
        }
    }
1128524
@Override
	public SqlEntityQuery<E> asc(final String col, final Nulls nulls) {
		this.sortOrders.add(new SortOrder(col, Order.ASCENDING, nulls));
		return this;
	}
398908
def as_name(value)
      case true
      when value.tag?
        element(value).name
      when value.dicom_name?
        @methods_from_names.has_key?(value) ? value.to_s : nil
      when value.dicom_method?
        @names_from_methods[value.to_sym]
      else
        nil
      end
    end
926547
public <T> T get(Class<T> as) {
    if (content == null) {
      return null;
    }
    if (as == null) {
      throw new IllegalArgumentException("Cannot cast content to null class");
    }
    if (!as.isAssignableFrom(content.getClass())) {
      throw new IllegalArgumentException(
        "Cannot cast "+content.getClass().getName()+" to "+as.getName()
      );
    }
    @SuppressWarnings("unchecked")
    T content = (T) get();
    return content;
  }
1113702
public <T> T convert(Object source, Class<T> toClass) {
        return toClass.cast(source.toString());
    }
721034
@Nonnull
  @CodingStyleguideUnaware
  public JSDefinedClass _extends (@Nonnull final AbstractJSClass aSuperClass)
  {
    m_aSuperClass = ValueEnforcer.notNull (aSuperClass, "SuperClass");
    return this;
  }
551084
@Override
	public <T> T asObject(String string, Class<T> valueType) {
		// at this point value type is a boolean or a boxing boolean
		string = string.toLowerCase();
		if (string.equals("true")) {
			return (T) (Boolean) true;
		}
		if (string.equals("yes")) {
			return (T) (Boolean) true;
		}
		if (string.equals("1")) {
			return (T) (Boolean) true;
		}
		if (string.equals("on")) {
			return (T) (Boolean) true;
		}
		return (T) (Boolean) false;
	}
397849
<T> Class<?> transform(Class<T> proxyInterface) {
    try {
      String packageName = proxyInterface.getPackage().getName();
      String genericProxyInterfaceName =
          packageName + "." + PROXY_PREFIX + proxyInterface.getSimpleName();
      try {
        return Class.forName(genericProxyInterfaceName);
      } catch (ClassNotFoundException e) {
        pool.insertClassPath(new ClassClassPath(proxyInterface));
        CtClass copy = pool.getAndRename(proxyInterface.getName(), genericProxyInterfaceName);
        replaceGenericResponseMethods(copy);

        return copy
            .toClass(this.getClass().getClassLoader(), this.getClass().getProtectionDomain());
      }
    } catch (NotFoundException e) {
      throw new RuntimeException(e);
    } catch (CannotCompileException e) {
      throw new RuntimeException(e);
    } catch (BadBytecode e) {
      throw new RuntimeException(e);
    }
  }
842902
private <T> List<T> asList(Object value, Class<T> ofClass) {
        @SuppressWarnings("unchecked")
        T[] values = (T[]) value;
        return Arrays.asList(values);
    }
229239
public static List<Object> asList(final Object object, final Class<?> componentType) {
        ArgUtils.notNull(componentType, "componentType");

        if(object == null) {
            return new ArrayList<>();
        }

        if(!object.getClass().isArray()) {
            throw new IllegalArgumentException(String.format("args0 is not arrays : %s.", object.getClass().getName()));
        }

        if(!componentType.isPrimitive()) {
            return Arrays.asList((Object[])object);
        }

        if(componentType.equals(boolean.class)) {
            boolean[] array = (boolean[])object;
            List<Object> list = new ArrayList<>(array.length);
            for(boolean v : array) {
                list.add(v);
            }
            return list;

        } else if(componentType.equals(char.class)) {
            char[] array = (char[])object;
            List<Object> list = new ArrayList<>(array.length);
            for(char v : array) {
                list.add(v);
            }
            return list;

        } else if(componentType.equals(byte.class)) {
            byte[] array = (byte[])object;
            List<Object> list = new ArrayList<>(array.length);
            for(byte v : array) {
                list.add(v);
            }
            return list;

        } else if(componentType.equals(short.class)) {
            short[] array = (short[])object;
            List<Object> list = new ArrayList<>(array.length);
            for(short v : array) {
                list.add(v);
            }
            return list;

        } else if(componentType.equals(int.class)) {
            int[] array = (int[])object;
            List<Object> list = new ArrayList<>(array.length);
            for(int v : array) {
                list.add(v);
            }
            return list;

        } else if(componentType.equals(long.class)) {
            long[] array = (long[])object;
            List<Object> list = new ArrayList<>(array.length);
            for(long v : array) {
                list.add(v);
            }
            return list;

        } else if(componentType.equals(float.class)) {
            float[] array = (float[])object;
            List<Object> list = new ArrayList<>(array.length);
            for(float v : array) {
                list.add(v);
            }
            return list;

        } else if(componentType.equals(double.class)) {
            double[] array = (double[])object;
            List<Object> list = new ArrayList<>(array.length);
            for(double v : array) {
                list.add(v);
            }
            return list;

        }

        throw new IllegalArgumentException(String.format("not support primitive type : %s.", componentType.getName()));

    }
481152
@Override
    public String as( As annotation, Method method ) {
        if( annotation != null && annotationHasExplicitValue( annotation ) ) {
            return annotation.value();
        }

        return methodNameToReadableText( method.getName() );
    }