Example usage for java.lang Byte valueOf

List of usage examples for java.lang Byte valueOf

Introduction

In this page you can find the example usage for java.lang Byte valueOf.

Prototype

public static Byte valueOf(String s) throws NumberFormatException 

Source Link

Document

Returns a Byte object holding the value given by the specified String .

Usage

From source file:org.sofun.core.kup.KupServiceImpl.java

private static final List<Byte> toByteList(byte[] a) {
    final List<Byte> r = new ArrayList<Byte>();
    for (int i = 0; i < a.length; i++) {
        r.add(Byte.valueOf(a[i]));
    }/*from  w ww  .  j a  v  a 2  s . c  o m*/
    return r;
}

From source file:org.op4j.functions.FnBigInteger.java

/**
* <p>//from  ww w .j av a  2 s  .  c  om
* It subtracts the given number from the target and returns the result
* </p>
* 
* @param subtract number to be subtracted from the target
* @return the result of the subtraction
*/
public final static Function<BigInteger, BigInteger> subtract(byte subtract) {
    return subtract(Byte.valueOf(subtract));
}

From source file:de.minigameslib.mclib.api.config.ConfigurationValueInterface.java

/**
 * Sets the value to this configuration variable.
 * /*from w  ww.  j  a  v  a  2 s  .  co m*/
 * @param value
 *            value to set.
 * @param subpath
 *            the sub path
 */
default void setByte(byte value, String subpath) {
    ConfigurationTool.consume(this, subpath, (val, configs, config, lib, minigame, path) -> {
        minigame.getConfig(configs.file()).set(path, Byte.valueOf(value));
    });
}

From source file:de.minigameslib.mclib.api.config.ConfigurationValueInterface.java

@Override
default void setByte(byte value) {
    ConfigurationTool.consume(this, ConfigurationByte.class, ConfigurationTool.bytePath(),
            (val, configs, config, lib, minigame, path) -> {
                minigame.getConfig(configs.file()).set(path, Byte.valueOf(value));
            });/* www. ja v a2 s . c  o  m*/
}

From source file:org.op4j.functions.FnObject.java

/**
 * <p>/*w w w. j  ava2  s . com*/
 * Determines whether the target object is greater than the specified object
 * in value, this is, whether <tt>target.compareTo(object) > 0</tt>. Both
 * the target and the specified object have to implement {@link Comparable}.
 * </p>
 * 
 * @param object the object to compare to the target
 * @return true if target is greater than the specified object, false if not
 */
public static final Function<Object, Boolean> greaterThan(final byte object) {
    return new GreaterThan(Byte.valueOf(object));
}

From source file:org.op4j.functions.FnLong.java

/**
* <p>//from  ww  w  .j av  a2 s  .  co m
* It adds the given number to the target and returns the result
* </p>
* 
* @param add value to be added to the target
* @return the result of the addition of add to the target number
*/
public final static Function<Long, Long> add(byte add) {
    return add(Byte.valueOf(add));
}

From source file:org.op4j.functions.FnFloat.java

/**
* <p>/*from  ww  w.  j a va  2 s  . c om*/
* It adds the given number to the target and returns the result
* </p>
* 
* @param add value to be added to the target
* @return the result of the addition of add to the target number
*/
public final static Function<Float, Float> add(byte add) {
    return add(Byte.valueOf(add));
}

From source file:org.op4j.functions.FnShort.java

/**
* <p>/*from w w  w  .  j  av  a 2  s.c  o  m*/
* It adds the given number to the target and returns the result
* </p>
* 
* @param add value to be added to the target
* @return the result of the addition of add to the target number
*/
public final static Function<Short, Short> add(byte add) {
    return add(Byte.valueOf(add));
}

From source file:org.apache.axis2.corba.receivers.CorbaUtil.java

public static Object parseValue(DataType type, String value) {
    if (value == null)
        return null;
    value = value.trim();/*from w w w  .j  a v a 2 s  .  c  o m*/
    Object ret = null;
    switch (type.getTypeCode().kind().value()) {
    case TCKind._tk_long:
        ret = Integer.valueOf(value);
        break;
    case TCKind._tk_ulong:
        ret = Integer.valueOf(value);
        break;
    case TCKind._tk_longlong:
        ret = Long.valueOf(value);
        break;
    case TCKind._tk_ulonglong:
        ret = Long.valueOf(value);
        break;
    case TCKind._tk_short:
        ret = Short.valueOf(value);
        break;
    case TCKind._tk_ushort:
        ret = Short.valueOf(value);
        break;
    case TCKind._tk_float:
        ret = Float.valueOf(value);
        break;
    case TCKind._tk_double:
        ret = Double.valueOf(value);
        break;
    case TCKind._tk_char:
        ret = Character.valueOf(value.charAt(0));
        break;
    case TCKind._tk_wchar:
        ret = Character.valueOf(value.charAt(0));
        break;
    case TCKind._tk_boolean:
        ret = Boolean.valueOf(value);
        break;
    case TCKind._tk_octet:
        ret = Byte.valueOf(value);
        break;
    case TCKind._tk_string:
        ret = value;
        break;
    case TCKind._tk_wstring:
        ret = value;
        break;
    case TCKind._tk_enum:
        EnumType enumType = (EnumType) type;
        EnumValue enumValue = new EnumValue(enumType);
        int i = enumType.getEnumMembers().indexOf(value);
        enumValue.setValue(i);
        ret = enumValue;
        break;
    default:
        log.error("ERROR! Invalid dataType");
        break;
    }
    return ret;
}

From source file:org.op4j.functions.FnInteger.java

/**
* <p>//from  w  ww  .j  ava  2 s.co m
* It adds the given number to the target and returns the result
* </p>
* 
* @param add value to be added to the target
* @return the result of the addition of add to the target number
*/
public final static Function<Integer, Integer> add(byte add) {
    return add(Byte.valueOf(add));
}