List of usage examples for java.lang Integer longValue
public long longValue()
From source file:com.mmj.app.biz.service.impl.CommentsServiceImpl.java
@Override public Long add(CommentsDO... t) { t = ArrayUtils.removeNullElement(t); if (Argument.isEmptyArray(t)) { return 0l; }/*from w w w . jav a 2 s .co m*/ Integer count = commentsDao.insert(t); if (t.length == 1) { return count.longValue(); } return count == 0 ? 0l : 1l; }
From source file:com.mmj.app.biz.service.impl.LetterServiceImpl.java
@Override public Long add(DialogDO... t) { t = ArrayUtils.removeNullElement(t); if (Argument.isEmptyArray(t)) { return 0l; }//from w ww.j ava2s .c o m Integer count = dialogDao.insert(t); if (t.length == 1) { return count.longValue(); } return count == 0 ? 0l : 1l; }
From source file:com.mmj.app.biz.service.impl.LetterServiceImpl.java
@Override public Long add(LetterDO... t) { t = ArrayUtils.removeNullElement(t); if (Argument.isEmptyArray(t)) { return 0l; }/* ww w. ja v a 2s .c o m*/ Integer count = letterDao.insert(t); if (t.length == 1) { return count.longValue(); } return count == 0 ? 0l : 1l; }
From source file:org.eclipse.smarthome.binding.openweathermap.internal.handler.AbstractOpenWeatherMapHandler.java
protected State getDateTimeTypeState(@Nullable Integer value) { return (value == null) ? UnDefType.UNDEF : new DateTimeType( ZonedDateTime.ofInstant(Instant.ofEpochSecond(value.longValue()), ZoneId.systemDefault())); }
From source file:com.mmj.app.biz.service.impl.LetterServiceImpl.java
@Override public Long add(NotificationDO... t) { t = ArrayUtils.removeNullElement(t); if (Argument.isEmptyArray(t)) { return 0l; }/* w ww . j a va2 s .c o m*/ Integer count = notificationDao.insert(t); if (t.length == 1) { return count.longValue(); } return count == 0 ? 0l : 1l; }
From source file:org.guzz.id.TableHiLoGenerator.java
public synchronized Number generate(Object tableCondition) { if (maxLo < 1) { //open a new transaction. WriteTranSession session = this.tm.openRWTran(true); try {//from ww w . ja va 2 s . co m //keep the behavior consistent even for boundary usages Integer n = super.nextValueInTable(session, tableCondition); if (n.intValue() == 0) { n = super.nextValueInTable(session, tableCondition); } return IdentifierGeneratorFactory.createNumber(n.longValue(), this.returnType); } finally { session.close(); } } if (lo > maxLo) { //open a new transaction. WriteTranSession session = this.tm.openRWTran(true); try { Number n = super.nextValueInTable(session, tableCondition); int hival = n.intValue(); lo = (hival == 0) ? 1 : 0; hi = hival * (maxLo + 1); if (log.isDebugEnabled()) { log.debug("new hi value: " + hival); } } finally { session.close(); } } return IdentifierGeneratorFactory.createNumber(hi + lo++, this.returnType); }
From source file:org.eurekastreams.server.persistence.DomainEntityMapper.java
/** * Find the domain entity by id./*w w w . ja va2 s . co m*/ * * @param domainEntityId * ID of the entity to look up * @return the entity with the input */ public T findById(final Integer domainEntityId) { return findById(domainEntityId.longValue()); }
From source file:com.ge.predix.uaa.token.lib.FastTokenServices.java
protected Date getExpDate(final Map<String, Object> claims) { Integer exp = (Integer) claims.get(EXP); return new Date((exp.longValue() + this.maxAcceptableClockSkewSeconds) * 1000L); }
From source file:com.ge.predix.uaa.token.lib.FastTokenServices.java
protected Date getIatDate(final Map<String, Object> claims) { Integer iat = (Integer) claims.get("iat"); return new Date((iat.longValue() - this.maxAcceptableClockSkewSeconds) * 1000L); }
From source file:org.yukung.tasklet.dao.impl.ActivityDaoImpl.java
@Override public Long getCountByUserId(int userId) { String sql = getSQLFromPropertyFile("getCountByUserId"); ResultSetHandler<Object> rsh = new ScalarHandler(1); try {// ww w .ja va 2s . c o m Integer count = (Integer) runner.query(sql, rsh, Integer.valueOf(userId)); return Long.valueOf(count.longValue()); } catch (SQLException e) { throw new DataAccessException(e.getMessage(), e); } }