Converts primitive types to their boxed equivalent {@link int} converts
to {@link Integer}. If not conversion was found the parameter is returned
without modification.

@param unboxed the type to convert
@return the boxed type
189155
private static Class<?> convert(Class<?> unboxed) {
        Class<?> boxed = BOXED_EQUIVALENT.get(unboxed);
        return boxed == null ? unboxed : boxed;
    }
940430
public int[] toIntegerArray() {
    int[] copy = new int[size];
    for (int i = 0; i < size; i++) {
      copy[i] = elements[i];
    }
    return copy;
  }
507436
protected int getEntryTypeInt(int flags) {

        for (int i = 0; i < getTypesInt().length; i++) {
            if ((flags & getTypesInt()[i]) > 0) {
                return i;
            }
        }
        return -1;
    }
1157521
public static Integer toInt(Object value, Integer defaultValue) {
		return convert(Integer.class, value, defaultValue);
	}
845408
public Class<?> getBoxedType() {
        if (mBoxedType == null) {
            mBoxedType = TypeDesc.forClass(getType()).toObjectType().toClass();
        }
        return mBoxedType;
    }
4049
protected int[] convert( final Integer[] ints) {
		int[] array = new int[ ints.length];
		int count = 0;
		for ( int i : ints) array[ count++] = i;
		return array;
	}
80312
public Type boxedTypeOrType(Type t) {
        return t.isPrimitive() ?
            boxedClass(t).type :
            t;
    }
91199
public static BigInteger fromUnsignedByteArray(byte[] buf, int off, int length) {
		byte[] mag = buf;
		if (off != 0 || length != buf.length) {
			mag = new byte[length];
			System.arraycopy(buf, off, mag, 0, length);
		}
		return new BigInteger(1, mag);
	}
547645
public int getInteger(String key, int defaultValue) {
		Object o = getObject(key);
		if (o == null) {
			return defaultValue;
		}
		int val = defaultValue;
		try {
			val = Integer.parseInt(o.toString());
		}
		catch (Exception e) {
			throw new IllegalArgumentException("Object ["+o+"] associated with key ["+key+"] is not of type Integer.");
		}
		return val;
	}
419918
public static Integer[] boxIntegers(Object src, int srcPos, int len) {
        return boxIntegers(array(src), srcPos, len);
    }
61606
public boolean isBoxedPrimitive() {
    return this.equals(BOXED_BOOLEAN)
        || this.equals(BOXED_BYTE)
        || this.equals(BOXED_SHORT)
        || this.equals(BOXED_INT)
        || this.equals(BOXED_LONG)
        || this.equals(BOXED_CHAR)
        || this.equals(BOXED_FLOAT)
        || this.equals(BOXED_DOUBLE);
  }
1073653
function cancelBoxed() {
    const boxed = this.boxed;
    this.boxed = UNDEFINED;
    return boxed && boxed[boxedImmutable.BOXED_GET_THIS].unboxedDelta();
}
233391
public Integer toInteger() {
		Integer value;
		value = Integer.valueOf(this.isNeg ? Integer.parseInt(this.param)*-1 : Integer.parseInt(this.param));
		return value;
	}
799692
public SoyExpression box() {
    if (isBoxed()) {
      return this;
    }
    if (soyType().equals(NullType.getInstance())) {
      if (delegate == NULL) {
        return NULL_BOXED;
      }
      return asBoxed(toStatement().then(NULL_BOXED));
    }
    // since we aren't boxed and these must be primitives so we don't need to worry about
    // nullability
    if (soyRuntimeType.isKnownBool()) {
      return asBoxed(MethodRef.BOOLEAN_DATA_FOR_VALUE.invoke(delegate));
    }
    if (soyRuntimeType.isKnownInt()) {
      return asBoxed(MethodRef.INTEGER_DATA_FOR_VALUE.invoke(delegate));
    }
    if (soyRuntimeType.isKnownFloat()) {
      return asBoxed(MethodRef.FLOAT_DATA_FOR_VALUE.invoke(delegate));
    }
    // If null is expected and it is a reference type we want to propagate null through the boxing
    // operation
    final boolean isNonNullable = delegate.isNonNullable();
    return asBoxed(
        new Expression(soyRuntimeType.box().runtimeType(), features()) {
          @Override
          protected void doGen(CodeBuilder adapter) {
            Label end = null;
            delegate.gen(adapter);
            if (!isNonNullable) {
              end = new Label();
              BytecodeUtils.nullCoalesce(adapter, end);
            }
            doBox(adapter, soyRuntimeType.asNonNullable());
            if (end != null) {
              adapter.mark(end);
            }
          }
        });
  }
409457
public static int unpackInt(final byte[] array, final JBBPIntCounter position) {
    final int code = array[position.getAndIncrement()] & 0xFF;
    if (code < 0x80) {
      return code;
    }

    final int result;
    switch (code) {
      case 0x80: {
        result = ((array[position.getAndIncrement()] & 0xFF) << 8) | (array[position.getAndIncrement()] & 0xFF);
      }
      break;
      case 0x81: {
        result = ((array[position.getAndIncrement()] & 0xFF) << 24)
            | ((array[position.getAndIncrement()] & 0xFF) << 16)
            | ((array[position.getAndIncrement()] & 0xFF) << 8)
            | (array[position.getAndIncrement()] & 0xFF);
      }
      break;
      default:
        throw new IllegalArgumentException("Unsupported packed integer prefix [0x" + Integer.toHexString(code).toUpperCase(Locale.ENGLISH) + ']');
    }
    return result;
  }
1065361
public org.inferred.freebuilder.processor.property.Property.Builder setBoxedType(
      TypeMirror boxedType) {
    this.boxedType = Objects.requireNonNull(boxedType);
    return (org.inferred.freebuilder.processor.property.Property.Builder) this;
  }
375538
static public int unpackInt(ByteBuffer bb)
      throws IOException {
    for (int offset = 0, result = 0; offset < 32; offset += 7) {
      int b = bb.get() & 0xffff;
      result |= (b & 0x7F) << offset;
      if ((b & 0x80) == 0) {
        return result;
      }
    }
    throw new Error("Malformed integer.");
  }