List of usage examples for java.lang Long longValue
@HotSpotIntrinsicCandidate public long longValue()
From source file:com.intuit.tank.project.JobValidator.java
public String getDuration(String group) { Long duration = expectedDuration.get(group); return TimeUtil.toTimeString(duration != null ? duration.longValue() : 0); }
From source file:com.redhat.rhn.domain.kickstart.KickstartFactory.java
/** * Lookup a list of KickstartableTree objects that use the passed in channelId * * @param channelId that owns the kickstart trees * @param org who owns the trees//w w w .java 2 s . co m * @return List of KickstartableTree objects */ public static List<KickstartableTree> lookupKickstartableTrees(Long channelId, Org org) { Session session = null; List retval = null; String query = null; query = "KickstartableTree.findByChannel"; session = HibernateFactory.getSession(); retval = session.getNamedQuery(query).setLong("channel_id", channelId.longValue()) .setLong("org_id", org.getId().longValue()).list(); return retval; }
From source file:io.github.albertopires.mjc.JConsoleM.java
public long getUpTime() throws Exception { ObjectName mbeanName;/* ww w.j a v a 2 s . c o m*/ mbeanName = new ObjectName("java.lang:type=Runtime"); Long ut; ut = (Long) mbsc.getAttribute(mbeanName, "Uptime"); return ut.longValue(); }
From source file:org.fcrepo.client.GetBuilder.java
/** * Set the byte range of content to retrieve * /* ww w .j a v a 2s . co m*/ * @param rangeStart beginning byte index * @param rangeEnd ending byte index * @return this builder */ public GetBuilder range(final Long rangeStart, final Long rangeEnd) { if (rangeStart != null || rangeEnd != null) { String range = "bytes="; if (rangeStart != null && rangeStart.longValue() > -1L) { range += rangeStart.toString(); } range += "-"; if (rangeEnd != null && rangeEnd.longValue() > -1L) { range += rangeEnd.toString(); } request.setHeader(RANGE, range); } return this; }
From source file:com.germinus.easyconf.ConfigurationLoader.java
private ConfigurationObjectCache readConfigurationObjectFromXMLFile(String companyId, String componentName, String confName, ComponentProperties properties) throws FileNotFoundException, IOException, SAXException { ConfigurationObjectCache result;//from ww w . ja v a 2 s . c om String confFileName = null; URL confFile = null; if (companyId != null) { confFileName = componentName + Conventions.SLASH + companyId + Conventions.XML_EXTENSION; confFile = ClasspathUtil.locateResource(null, confFileName); log.info("Loaded " + confFileName + ": " + confFile); } if (confFile == null) { if (confName == Conventions.DEFAULT_CONF_OBJECT_NAME) { confFileName = componentName + Conventions.XML_EXTENSION; } else { confFileName = componentName + Conventions.DOT + confName + Conventions.XML_EXTENSION; } confFile = ClasspathUtil.locateResource(null, confFileName); } if (confFile == null) { throw new FileNotFoundException("File " + confFileName + " not found"); } Object confObj = loadXMLFile(confFile, properties); result = new ConfigurationObjectCache(confObj, confFile, properties, confName); Long delay = properties.getDelayPeriod(); if (delay != null) { result.setReloadingStrategy(new FileURLChangedReloadingStrategy(confFile, delay.longValue())); } return result; }
From source file:io.github.albertopires.mjc.JConsoleM.java
public long getOSProcessCpuTime() throws Exception { ObjectName mbeanName;//w ww . jav a 2s .co m mbeanName = new ObjectName("java.lang:type=OperatingSystem"); Long ut; ut = (Long) mbsc.getAttribute(mbeanName, "ProcessCpuTime"); return ut.longValue(); }
From source file:xx.tream.chengxin.ms.service.TrainServiceImpl.java
public boolean checkByIdcard(String idcard) { String sql = "select count(id) num from tb_train where idcard = ?"; List<Map<String, Object>> list = this.dao.queryForList(sql, new Object[] { idcard }); if ((list != null) && (list.size() > 0)) { Map<String, Object> numMap = (Map<String, Object>) list.get(0); Long num = (Long) numMap.get("num"); if (num.longValue() > 0L) { return true; }//from ww w .j a va 2s . c o m } return false; }
From source file:org.yamj.core.api.model.dto.ApiFileDTO.java
public void setFileSize(Long fileSize) { if (fileSize != null) { this.fileSize = MetadataTools.formatFileSize(fileSize.longValue()); }/*from w w w . j a va 2s .c o m*/ }
From source file:com.redhat.rhn.domain.kickstart.KickstartFactory.java
/** * Lookup a ssl crypto key by its id./*from w w w . j a va 2 s .c om*/ * @param keyId to lookup * @param org who owns the key * @return SslCryptoKey if found. Null if not */ public static SslCryptoKey lookupSslCryptoKeyById(Long keyId, Org org) { Session session = null; SslCryptoKey retval = null; //look for Kickstart data by id session = HibernateFactory.getSession(); retval = (SslCryptoKey) session.getNamedQuery("SslCryptoKey.findByIdAndOrg") .setLong("key_id", keyId.longValue()).setLong("org_id", org.getId().longValue()).uniqueResult(); return retval; }
From source file:com.amazonaws.util.TimingInfo.java
@Deprecated public final long getEndEpochTimeMilli() { Long v = getEndEpochTimeMilliIfKnown(); return v == null ? UNKNOWN : v.longValue(); }