<p>
as.
</p>

@param t
a {@link java.lang.Class} object.
@param obj
a {@link java.lang.Object} object.
@param <T>
a T object.
@return a T object.
428742
@SuppressWarnings("unchecked")
	public static <T> T as(Class<T> t, final Object obj) {
		return (T) Proxy.newProxyInstance(t.getClassLoader(), new Class[] { t }, new InvocationHandler() {
			public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
				try {
					return obj.getClass().getMethod(method.getName(), method.getParameterTypes()).invoke(obj, args);
				} catch (NoSuchMethodException nsme) {
					throw new NoSuchMethodError(nsme.getMessage());
				} catch (InvocationTargetException ite) {
					throw ite.getTargetException();
				}
			}
		});
	}
410508
public T create(final Class<T> klass) {
    T obj;
    try {
      obj = (T) klass.newInstance();
    }
    catch (IllegalAccessException e) {
      throw new DocrepException(e);
    }
    catch (InstantiationException e) {
      throw new DocrepException(e);
    }
    add(obj);
    return obj;
  }
79443
public static ASN1OctetString getInstance(
        Object  obj)
    {
        if (obj == null || obj instanceof ASN1OctetString)
        {
            return (ASN1OctetString)obj;
        }

        if (obj instanceof ASN1TaggedObject)
        {
            return getInstance(((ASN1TaggedObject)obj).getObject());
        }

        if (obj instanceof ASN1Sequence)
        {
            Vector      v = new Vector();
            Enumeration e = ((ASN1Sequence)obj).getObjects();

            while (e.hasMoreElements())
            {
                v.addElement(e.nextElement());
            }

            return new BERConstructedOctetString(v);
        }

        throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName());
    }
449388
public <T> T asObject(Class<T> type)
	{
		return config.asObject(key, type);
	}
19578
static public <T> Class<? extends T> getClass(T obj)
	{
		return (Class<? extends T>)obj.getClass();
	}
671020
@SuppressWarnings("unchecked")
        public static <T> ClassSup<T> cls(T obj) {
                return mapper.get(obj.getClass().getName(), () -> (ClassSup<T>) cls(obj.getClass()));
        }
586918
function (obj) {
            if (typeof obj === "undefined")
                /*  get current object  */
                return this.__obj;
            else if (typeof obj === "object") {
                /*  set new object  */
                if (obj !== null) {
                    _cs.annotation(obj, "comp", this);
                    this.__obj = obj;
                }
                else {
                    if (this.__obj !== null)
                        _cs.annotation(this.__obj, "comp", null);
                    this.__obj = null;
                }
            }
            else
                throw _cs.exception("obj", "invalid argument");
            return this;
        }
284606
public double count(T obj) {
        double count = counts.get(obj);
        count++;
        counts.put(obj, count);
        sum++;
        return count;
    }
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);
            }
        }
    }
344334
public Iterable<Obj> asObjSeq(final @Nullable Obj obj) {
		return new Iterable<Obj>() {
			@Override public Iterator<Obj> iterator() {
				if (obj != null) {
					final Iterator<Entry<String, Object>> i = obj.iterator();
					return new Iterator<Obj>() {
						@Override public boolean hasNext() {
							return i.hasNext();
						}
						@Override public Obj next() {
							return (Obj) i.next().getValue();
						}
						@Override public void remove() {
							Check.unsupportedoperation.fail();
						}
					};
				}
				return java.util.Collections.emptyIterator();
			}
		};
	}
344947
public static <T> T convertToObject(Object genericObject) {

        try {
            return (T) innerToConvertObject(genericObject, new IdentityHashMap<Object, Object>());
        } catch (Throwable t) {
            throw new ConvertException(t);
        }
    }
858603
public static <T> T cast(Object obj, String type) {
        return (T) cast(obj, resolveType(type));
    }
125346
public static <T extends Serializable> byte[] serializeIntoBytes(T obj) throws IOException {
    try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(bos)) {
      oos.writeObject(obj);
      oos.flush();
      return bos.toByteArray();
    }
  }
282614
public Iterator<?> getBshIterator(final Object obj) {
        if (obj == null)
            return this.emptyIt();
        if (obj instanceof Primitive)
            return this.getBshIterator(Primitive.unwrap(obj));
        if (obj.getClass().isArray())
            return this.arrayIt(obj);
        if (obj instanceof Iterable)
            return this.getBshIterator((Iterable<?>) obj);
        if (obj instanceof Iterator)
            return this.getBshIterator((Iterator<?>) obj);
        if (obj instanceof Enumeration)
            return this.getBshIterator((Enumeration<?>) obj);
        if (obj instanceof CharSequence)
            return this.getBshIterator((CharSequence) obj);
        if (obj instanceof Number)
            return this.getBshIterator((Number) obj);
        if (obj instanceof Character)
            return this.getBshIterator((Character) obj);
        if (obj instanceof String)
            return this.getBshIterator((String) obj);
        return this.reflectNames(obj).iterator();
    }
495823
@SuppressWarnings("unchecked")
    public Object transform(final Object obj) {
        if (obj != null && !(obj instanceof BeanMap)) {
            Class clazz = obj.getClass();
            if (clazz.isArray()) {
                return _transform((Object[]) obj);
            } else if (obj instanceof Map) {
                return _transform((Map) obj);
            } else if (obj instanceof List) {
                return _transform((List) obj);
            } else if (obj instanceof Set) {
                return _transform((Set) obj);
            } else if (obj instanceof Collection) {
                return _transform((Collection) obj);
            } else if (obj instanceof Iterable) {
                return _transform((Iterable) obj);
            } else if (obj instanceof Iterator) {
                return _transform((Iterator) obj);
            } else if (needTransform(obj)) {
                return onTransform(obj);
            }
        }
        return obj;
    }
994517
@SuppressWarnings("unchecked")
	public static @Nullable <T> T as(Object object, Class<T> cls) {
		return cls.isInstance(object) ? (T) object : null;
	}
276598
public static Object[] toArray(Object obj)
	{
		if (obj instanceof Object[])
			return (Object[]) obj;
		else
		{
			Object[] returnArray =
			{ obj };
			return returnArray;

		}
	}