@Override protected Short doForward(String value) { return Short.decode(value); }
@Override protected Short doForward(String value) { return Short.decode(value); }
@Override protected Short doForward(String value) { return Short.decode(value); }
@Override protected Short doForward(String value) { return Short.decode(value); }
/** * Decodes this {@code CharSeq} into a {@code Short} by calling {@link Short#decode(String)}. * <p> * We write * * <pre><code> * Short value = charSeq.decodeShort(); * </code></pre> * * instead of * * <pre><code> * Short value = Short.decode(charSeq.mkString()); * </code></pre> * * @return a {@code Short} object holding the short value represented by this {@code CharSeq} * @throws NumberFormatException if this {@code CharSeq} does not contain a parsable short. */ public Short decodeShort() { return Short.decode(back); }
public Short parseValue(final String string, final ClassLoader classLoader) throws IllegalArgumentException { return Short.decode(string.trim()); } });
/** * Returns the value as a short. * * @param columnIndex (1,2,...) * @return the value */ @Override public short getShort(int columnIndex) throws SQLException { Object o = get(columnIndex); if (o != null && !(o instanceof Number)) { o = Short.decode(o.toString()); } return o == null ? 0 : ((Number) o).shortValue(); }
public Short convert(String s) { return Short.decode(s); } };
/** * Returns the value as a short. * * @param columnIndex (1,2,...) * @return the value */ @Override public short getShort(int columnIndex) throws SQLException { Object o = get(columnIndex); if (o != null && !(o instanceof Number)) { o = Short.decode(o.toString()); } return o == null ? 0 : ((Number) o).shortValue(); }
return (T) (isHexNumber(trimmed) ? Short.decode(trimmed) : Short.valueOf(trimmed));
resultList[i] = Byte.decode(value); } else if (short.class.equals(cl) || Short.class.equals(cl)) { resultList[i] = Short.decode(value); } else if (char.class.equals(cl) || Character.class.equals(cl)) { resultList[i] = Character.valueOf(value.charAt(0));
resultList[i] = Byte.decode(value); } else if (short.class.equals(cl) || Short.class.equals(cl)) { resultList[i] = Short.decode(value); } else if (char.class.equals(cl) || Character.class.equals(cl)) { resultList[i] = Character.valueOf(value.charAt(0));
return (T) (isHexNumber(trimmed) ? Short.decode(trimmed) : Short.valueOf(trimmed));
break; case Types.TINYINT: rs.updateShort(columnIndex, Short.decode(x)); break; default:
@Test public void testFsPermissionOperation() { HashMap<String, Integer> permsCode = new HashMap<String, Integer>(); for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { for (int k = 0; k < 8; k++) { StringBuilder sb = new StringBuilder(); sb.append("0"); sb.append(i); sb.append(j); sb.append(k); Integer code = (((i * 8) + j) * 8) + k; String perms = (new FsPermission(Short.decode(sb.toString()))).toString(); if (permsCode.containsKey(perms)) { Assert.assertEquals("permissions(" + perms + ") mapped to multiple codes", code, permsCode.get(perms)); } permsCode.put(perms, code); assertFsPermissionTransformationIsGood(perms); } } } }
private static void validatePermissions(CliSessionState ss, HiveConf conf, String perms) { perms = perms.trim(); FsPermission fp = null; if (perms.matches("^\\s*([r,w,x,-]{9})\\s*$")) { fp = FsPermission.valueOf("d" + perms); } else if (perms.matches("^\\s*([0-7]{3})\\s*$")) { fp = new FsPermission(Short.decode("0" + perms)); } else { ss.err.println("Invalid permission specification: " + perms); sysExit(ss,1); } if (!HCatUtil.validateMorePermissive(fp.getUserAction(), fp.getGroupAction())) { ss.err.println("Invalid permission specification: " + perms + " : user permissions must be more permissive than group permission "); sysExit(ss,1); } if (!HCatUtil.validateMorePermissive(fp.getGroupAction(), fp.getOtherAction())) { ss.err.println("Invalid permission specification: " + perms + " : group permissions must be more permissive than other permission "); sysExit(ss,1); } if ((!HCatUtil.validateExecuteBitPresentIfReadOrWrite(fp.getUserAction())) || (!HCatUtil.validateExecuteBitPresentIfReadOrWrite(fp.getGroupAction())) || (!HCatUtil.validateExecuteBitPresentIfReadOrWrite(fp.getOtherAction()))) { ss.err.println("Invalid permission specification: " + perms + " : permissions must have execute permissions if read or write permissions are specified "); sysExit(ss,1); } conf.set(HCatConstants.HCAT_PERMS, "d" + fp.toString()); }
@Override public Short getShort(String propertyName) { Short value = null; String valueString = properties.get(propertyName); if (valueString != null) { try { if (properties.containsKey(propertyName)) { value = Short.decode(valueString); } } catch (Exception ex) { Log.e(TAG, String.format("Could not get Short for propertyName: %s", propertyName), ex); } } return value; }
public Short getShort(final String propertyName) { Short value = null; String valueString = properties.get(propertyName); if (valueString != null) { try { if (properties.containsKey(propertyName)) { value = Short.decode(valueString); } } catch (Exception ex) { // Do not log property due to potential sensitive information. log.error("Could not get Short for property."); } } return value; }
j++; decoded.write(Short.decode( "0" + value.substring(i + 1, j)).byteValue()); i = j - 1;
return (T) (isHexNumber(trimmed) ? Short.decode(trimmed) : Short.valueOf(trimmed));