/** * Method that will try to convert value of current token to a * <b>long</b>. * Numbers are coerced using default Java rules; booleans convert to 0 (false) * and 1 (true), and Strings are parsed using default Java language integer * parsing rules. *<p> * If representation can not be converted to a long (including structured type * markers like start/end Object/Array) * default value of <b>0L</b> will be returned; no exceptions are thrown. */ public long getValueAsLong() throws IOException { return getValueAsLong(0); }
@Override public long getValueAsLong() throws IOException { return delegate.getValueAsLong(); } @Override public long getValueAsLong(long defaultValue) throws IOException { return delegate.getValueAsLong(defaultValue); }
@Override public long getValueAsLong() throws IOException { return delegate.getValueAsLong(); } @Override public long getValueAsLong(long defaultValue) throws IOException { return delegate.getValueAsLong(defaultValue); }
@Override public long getValueAsLong(long defaultValue) throws IOException { return delegate.getValueAsLong(defaultValue); } @Override public double getValueAsDouble() throws IOException { return delegate.getValueAsDouble(); }
@Override public long getValueAsLong(long defaultValue) throws IOException { return delegate.getValueAsLong(defaultValue); } @Override public double getValueAsDouble() throws IOException { return delegate.getValueAsDouble(); }
/** * Method that will try to convert value of current token to a * <b>long</b>. * Numbers are coerced using default Java rules; booleans convert to 0 (false) * and 1 (true), and Strings are parsed using default Java language integer * parsing rules. *<p> * If representation can not be converted to a long (including structured type * markers like start/end Object/Array) * default value of <b>0L</b> will be returned; no exceptions are thrown. */ public long getValueAsLong() throws IOException { return getValueAsLong(0); }
@Override public long getValueAsLong() throws IOException { return delegate.getValueAsLong(); } @Override public long getValueAsLong(long defaultValue) throws IOException { return delegate.getValueAsLong(defaultValue); }
@Override public long getValueAsLong(long defaultValue) throws IOException { return delegate.getValueAsLong(defaultValue); } @Override public double getValueAsDouble() throws IOException { return delegate.getValueAsDouble(); }
@Override public Date deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { return new Date(jp.getValueAsLong() * 1000L); } }
@Override public Date deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { return new Date(jp.getValueAsLong()); } }
@Override public T parse(JsonParser jsonParser) throws IOException { return getFromLong(jsonParser.getValueAsLong()); }
@Override public BigDecimal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { return new BigDecimal(jp.getValueAsLong()).movePointLeft(8); } }
apps.setVersion(jp.getValueAsLong()); } else if (appHashCodeKey.equals(fieldName)){ apps.setAppsHashCode(jp.getValueAsString());
break; case EVICTION_TIMESTAMP: builder.setEvictionTimestamp(jp.getValueAsLong()); break; case LAST_RENEW_TIMESTAMP: builder.setRenewalTimestamp(jp.getValueAsLong()); break; case REG_TIMESTAMP: builder.setRegistrationTimestamp(jp.getValueAsLong()); break; case RENEW_INTERVAL: break; case SERVICE_UP_TIMESTAMP: builder.setServiceUpTimestamp(jp.getValueAsLong()); break;
} else if("lastLogonTime".equalsIgnoreCase(fieldName)) { if(jp.getValueAsString() != null) { user.setLastLogonTime(jp.getValueAsLong()); user.setPreviousLogonTime(jp.getValueAsLong());
_failDoubleToIntCoercion(p, ctxt, "long"); return p.getValueAsLong(); case JsonTokenId.ID_NULL: _verifyNullForPrimitive(ctxt);
_failDoubleToIntCoercion(p, ctxt, "Long"); return p.getValueAsLong(); case JsonTokenId.ID_STRING: String text = p.getText().trim();
break; case LASTUPDATEDTS: builder.setLastUpdatedTimestamp(jp.getValueAsLong()); break; case LASTDIRTYTS: builder.setLastDirtyTimestamp(jp.getValueAsLong()); break; case ACTIONTYPE:
@Override public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException { Object id = p.getCurrentToken().isNumeric() ? p.getValueAsLong() : p.getValueAsString(); return invoker.invokeFindById(id).orElse(null); } }
public static Object getValueOfMagicField(JsonParser jp) throws IOException { switch (jp.getCurrentToken()) { case VALUE_TRUE: return TRUE; case VALUE_FALSE: return Boolean.FALSE; case VALUE_NUMBER_FLOAT: return jp.getValueAsDouble(); case VALUE_NUMBER_INT: return jp.getValueAsLong(); case VALUE_STRING: return jp.getValueAsString(); case VALUE_NULL: return null; default: throw new RakamException("The value of magic field is unknown", BAD_REQUEST); } }