Example usage for java.lang Long longValue

List of usage examples for java.lang Long longValue

Introduction

In this page you can find the example usage for java.lang Long longValue.

Prototype

@HotSpotIntrinsicCandidate
public long longValue() 

Source Link

Document

Returns the value of this Long as a long value.

Usage

From source file:edu.utah.further.mdr.ws.api.to.AssetToImpl.java

/**
 * @param activationTime/* w  ww. j a  va2  s.  co m*/
 * @see edu.utah.further.mdr.api.to.asset.AssetTo#setActivationTime(java.lang.Long)
 */
public void setActivationTime(final Long activationTime) {
    activationInfo
            .setActivationDate((activationTime == null) ? null : new Timestamp(activationTime.longValue()));
}

From source file:io.sulite.SQLitePlugin.java

/**
 * Close a database.//from w  w w.j  av a2 s .  c o  m
 *
 * @param dbName
 *            The name of the database-NOT including its extension.
 *
 */
private void closeDatabase(String dbName) {
    Long mydb = this.getDatabase(dbName);

    if (mydb != null) {
        SQLiteGlue.sqlg_db_close(mydb.longValue());
        dbmap.remove(dbName);
    }
}

From source file:org.eclipse.virgo.ide.manifest.internal.core.BundleManifestManager.java

/**
 * Internal method to locate and load {@link BundleManifest}s for given {@link IJavaProject}.
 * @param testBundle//from w ww.  j  a v  a 2  s  .  co  m
 */
private BundleManifest loadBundleManifest(IJavaProject javaProject, boolean testBundle) {
    IFile manifestFile = BundleManifestUtils.locateManifest(javaProject, testBundle);
    BundleManifest oldBundleManifest = null;

    Map<IJavaProject, BundleManifest> manifests = (testBundle ? testBundles : bundles);
    Map<IJavaProject, Long> timestamps = (testBundle ? testBundleTimestamps : bundleTimestamps);

    if (manifestFile == null) {
        try {
            w.lock();
            manifests.remove(javaProject);
            timestamps.remove(javaProject);
            bundleManifestChanged(null, null, null, null, IMPORTS_CHANGED, javaProject);
        } finally {
            w.unlock();
        }
    }

    if (manifestFile != null) {
        r.lock();
        try {
            if (timestamps.containsKey(javaProject)) {
                Long oldTimestamp = timestamps.get(javaProject);
                oldBundleManifest = manifests.get(javaProject);
                if (oldTimestamp.longValue() >= manifestFile.getLocalTimeStamp()) {
                    return oldBundleManifest;
                }
            }
        } finally {
            r.unlock();
        }
        BundleManifest bundleManifest = BundleManifestUtils.getBundleManifest(javaProject, testBundle);
        try {
            w.lock();
            if (bundleManifest != null) {
                manifests.put(javaProject, bundleManifest);
            } else {
                manifests.remove(javaProject);
            }
            timestamps.put(javaProject, manifestFile.getLocalTimeStamp());
        } finally {
            w.unlock();
        }
        if (testBundle) {
            bundleManifestChanged(null, null, bundleManifest, oldBundleManifest, javaProject);
        } else {
            bundleManifestChanged(bundleManifest, oldBundleManifest, null, null, javaProject);
        }
        return bundleManifest;
    }
    return null;
}

From source file:com.apus.hades.admin.web.controller.ad.source.SourceController.java

@OperatLog(Handle = SystemHandle.EDIT, Module = SystemModule.SOURCE_MODEL)
public String update() {
    try {//from  www .j a  v a2 s  .com
        if (null == source || null == source.getId()) {
            throw new WebException("??");
        }
        if (source.getClick_actionEnum() == ClickAction.NONE) {
            source.setAction_url(StringUtils.EMPTY);
        }
        sourceManager.update(source);
        Long typeId = Struts2Utils.getLong("defaultTypeId");
        source = sourceManager.find(source.getId());
        if (source.getAd_type_id().longValue() == typeId.longValue()) {
            // ?
            updateSourceRelValue();
        } else {
            //  ?
            clearSourceRelValue();
            // ??
            saveSourceRelValue();
        }
    } catch (WebException e) {
        addActionMessage(e.getMessage());
    } catch (FileIOException e) {
        addActionError(",??");
        LOGGER.error(e.getMessage(), e);
        return add();
    } catch (Exception e) {
        addActionError("?:" + e.getMessage());
        LOGGER.error(e.getMessage(), e);
        return edit();
    }
    return list();
}

From source file:com.germinus.easyconf.AggregatedProperties.java

private Configuration addFileProperties(String fileName, CompositeConfiguration loadedConf)
        throws ConfigurationException {
    try {/*from ww  w  . j  av  a  2  s  .c  o m*/
        FileConfiguration newConf = new PropertiesConfiguration(fileName);
        URL fileURL = newConf.getURL();
        log.debug("Adding file: " + fileURL);

        Long delay = getReloadDelay(loadedConf, newConf);
        if (delay != null) {
            FileChangedReloadingStrategy reloadingStrategy = new FileConfigurationChangedReloadingStrategy();
            if (log.isDebugEnabled()) {
                log.debug("File " + fileURL + " will be reloaded every " + delay + " seconds");
            }
            long milliseconds = delay.longValue() * 1000;
            reloadingStrategy.setRefreshDelay(milliseconds);
            newConf.setReloadingStrategy(reloadingStrategy);
        }

        addIncludedPropertiesSources(newConf, loadedConf);
        return newConf;
    } catch (org.apache.commons.configuration.ConfigurationException e) {
        if (log.isDebugEnabled()) {
            log.debug("Configuration source " + fileName + " ignored");
        }
        return null;
    }
}

From source file:edu.utah.further.mdr.ws.api.to.AssetToImpl.java

/**
 * @param deactivationTime/*from   w  w  w  .  j  a va2 s .co  m*/
 * @see edu.utah.further.mdr.api.to.asset.AssetTo#setDeactivationTime(java.lang.Long)
 */
public void setDeactivationTime(final Long deactivationTime) {
    activationInfo.setDeactivationDate(
            (deactivationTime == null) ? null : new Timestamp(deactivationTime.longValue()));
}

From source file:br.gov.frameworkdemoiselle.internal.configuration.ConfigurationLoaderWithArrayTest.java

@Test
public void testConfigurationPropertiesWithLongArray() {
    ConfigurationPropertiesWithArray config = prepareConfigurationPropertiesWithArray();

    Long longValue = config.longArray[0];

    assertEquals(Long.class, longValue.getClass());
    assertEquals(Long.MAX_VALUE, longValue.longValue());
    assertEquals(5, config.longArray.length);
}

From source file:br.gov.frameworkdemoiselle.internal.configuration.ConfigurationLoaderWithArrayTest.java

@Test
public void testConfigurationXMLWithLongArray() {
    ConfigurationXMLWithArray config = prepareConfigurationXMLWithArray();

    Long longValue = config.longArray[0];

    assertEquals(Long.class, longValue.getClass());
    assertEquals(Long.MAX_VALUE, longValue.longValue());
    assertEquals(5, config.longArray.length);
}

From source file:br.gov.frameworkdemoiselle.internal.configuration.ConfigurationLoaderWithListTest.java

@Test
public void testConfigurationPropertiesWithLongList() {
    ConfigurationPropertiesWithList config = prepareConfigurationPropertiesWithList();

    Long longValue = config.longList.get(0);

    assertEquals(Long.class, longValue.getClass());
    assertEquals(Long.MAX_VALUE, longValue.longValue());
    assertEquals(5, config.longList.size());
}

From source file:br.gov.frameworkdemoiselle.internal.configuration.ConfigurationLoaderWithListTest.java

@Test
public void testConfigurationXMLWithLongList() {
    ConfigurationXMLWithList config = prepareConfigurationXMLWithList();

    Long longValue = config.longList.get(0);

    assertEquals(Long.class, longValue.getClass());
    assertEquals(Long.MAX_VALUE, longValue.longValue());
    assertEquals(5, config.longList.size());
}