object to integer converter

@param value
@param description
@returns {*}
14552
function parseIntValue(value, description) {
        if (description === void 0) { description = "integer"; }
        if (angular.isString(value)) {
            try {
                return parseInt(value);
            }
            catch (e) {
                console.log("Failed to parse " + description + " with text '" + value + "'");
            }
        }
        else if (angular.isNumber(value)) {
            return value;
        }
        return null;
    }
510524
function(value, hint) {
	if (hint) {
		var hintParser = this[hint[0].toUpperCase() + hint.slice(1)];
		if (hintParser) {
			return hintParser(value);
		}
	}

	var numberValue = Number(value);
	if (!isNaN(numberValue)) {
		return numberValue;
	}

	var lowerValue = value.toLowerCase();
	if (lowerValue === "true") {
		return true;
	}
	else if (lowerValue === "false") {
		return false;
	}

	return value;
}
189884
public static Integer parseInteger(String value) throws ParseException
   {
      Integer result = null;

      if (value.length() > 0 && value.indexOf(' ') == -1)
      {
         if (value.indexOf('.') == -1)
         {
            result = Integer.valueOf(value);
         }
         else
         {
            Number n = DatatypeConverter.parseDouble(value);
            result = Integer.valueOf(n.intValue());
         }
      }

      return result;
   }
262660
private static Number asNumber(Object value) {
    Number num = null;
    if (value == null) {
      num = null;
    } else if (value instanceof Number) {
      num = (Number) value;
    } else if (value instanceof Boolean) {
      num = ((Boolean) value) ? 1 : 0;
    }
    return num;
  }
16330
function toFraction (value) {
  var integer = Math.floor(value);
  var decimal = value - integer;
  var key = n2f(decimal);
  var result = value;

  if (vulgarities.hasOwnProperty(key)) {
    result = integer + vulgarities[key];
  }

  return result;
}
294903
public static final Integer getInteger(String value)
   {
      Integer result;

      try
      {
         result = Integer.valueOf(Integer.parseInt(value));
      }

      catch (Exception ex)
      {
         result = null;
      }

      return (result);
   }
397292
function(value) {
            var toString = Object.prototype.toString;
            return value === true || value === false || (!!value && typeof value === 'object' && toString.call(value) === '[object Boolean]');
        }
956328
function ( value ) {
            var result = Object.prototype.toString.call( value );
            result = result.match( /^\[\W*object\W+([a-zA-Z]+)\W*\]$/ );
    
            if ( result && result.length > 1 ) {
                result = result[1];
            }
    
            if ( result === 'String' ) {
                if ( $B.color.is(value) ) {
                    result = 'Color';
                }
            } else if ( result === 'Number' ) {
                if ( isNaN(value) ) {
                    result = 'NaN';
                }
            } else if ( result === 'Object' ) {
                if ( this.isUndefined(value) ) {
                    result = 'Undefined';
                } else if ( this.isNull(value) ) {
                    result = 'Null';
                } else if ( this.isElement(value) ) {
                    result = 'Element';
                }
            } else {
                if ( this.isElement(value) ) {
                    result = 'Element';
                }
            }
    
            return result;
        }
1159141
private int parseInteger(String value, int defaultValue)
	{
		try
		{
			return Integer.parseInt(value);
		}
		catch (NumberFormatException e)
		{
			return defaultValue;
		}
	}
421262
public static String writeInteger(Integer value) {
		if (value==null) return null;
		
		return Integer.toString(value);			
	}
760237
function encodeVarInt(value) {
    var bytes = [], cursor, length, i;

    do {
        bytes.push(value & 0x7F);
        value >>= 7;
    } while (value > 0);

    length = bytes.length;
    cursor = new BufferCursor(new buffer.Buffer(length));

    for (i = length - 1; i >= 0; i -= 1) {
        if (i > 0) {
            bytes[i] |= 0x80;
        }

        cursor.writeUInt8(bytes[i]);
    }

    return cursor.buffer;
}
74968
private void determineValueType(Object value){
		if (value instanceof Integer){
			this.valueEncoder.valueType = INTEGER;
			this.valueEncoder.valueBytes = ByteBuffer.allocate(4).putInt((Integer)value).array();
		}
		else if (value instanceof Long) {
			this.valueEncoder.valueType = LONG;
			this.valueEncoder.valueBytes = ByteBuffer.allocate(8).putLong((Long)value).array();
		}
		else if (value == null){
			this.valueEncoder.valueType = NULL;
		}
		else {
			ObjectOutputStream oos = null;
			try {
				ByteArrayOutputStream bos = new ByteArrayOutputStream();
				oos = new ObjectOutputStream(bos);
				oos.writeObject(value);
				this.valueEncoder.valueType = OBJECT;
				this.valueEncoder.valueBytes = bos.toByteArray();
			} catch (Exception e) {
				throw new IllegalStateException("Failed to serialize value: " + value, e);
			} finally {
				try {
					if (oos != null){
						oos.close();
					}
				} catch (Exception e2) {/*ignore*/}
			}
		}
	}
1142795
public static InputStreamResource buildInputStreamResourceFrom(final String value, final String description) {
        val reader = new StringReader(value);
        val is = new ReaderInputStream(reader, StandardCharsets.UTF_8);
        return new InputStreamResource(is, description);
    }
1167977
function num(type, value) {
  var val;
  if(type === NUMERIC.INTEGER) {
    val = utils.strtoint(value);
    if(isNaN(val)) throw IntegerRange;
  }else{
    val = utils.strtofloat(value);
    if(isNaN(val)) throw InvalidFloat;
  }
  return val;
}
620347
private String getIntegerString(Number value)
   {
      return (value == null ? null : Integer.toString(value.intValue()));
   }
1159385
def description(self, value):
        
        if not isinstance(value, six.string_types) and value is not None:
            raise ValueError("Pass a string, or None")
        self._properties["description"] = value
1006418
public WebFragmentDescriptor description(String ... values)
   {
      if (values != null)
      {
         for(String name: values)
         {
            model.createChild("description").text(name);
         }
      }
      return this;
   }