/** * @inheritDoc */ public double getDouble() throws ValueFormatException, RepositoryException { return property.getDouble(); }
public Object jsGet_double() { try { return property.getDouble(); } catch (RepositoryException re) { return Undefined.instance; } }
public static Double getDoubleProperty(final Node node, final String property) throws RepositoryException { if (node.hasProperty(property)) { return node.getProperty(property).getDouble(); } else { return null; } }
public static Double getDoubleProperty(final Node node, final String property) throws RepositoryException { if (node.hasProperty(property)) { return node.getProperty(property).getDouble(); } else { return null; } }
private long getPasswordMaxAge() throws RepositoryException { Node securityNode = session.getRootNode().getNode(SECURITY_PATH); if (securityNode.hasProperty(HippoNodeType.HIPPO_PASSWORDMAXAGEDAYS)) { return (long) (securityNode.getProperty(HippoNodeType.HIPPO_PASSWORDMAXAGEDAYS).getDouble() * ONEDAYMS); } return -1l; }
private String getLastExecutedAction(final Node moduleNode) throws RepositoryException { if (moduleNode.hasProperty(HCM_LAST_EXECUTED_ACTION)) { return moduleNode.getProperty(HCM_LAST_EXECUTED_ACTION).getString(); } // backwards compatibility with baselines stored during v12-beta else if (moduleNode.hasProperty(HCM_MODULE_SEQUENCE)) { return Double.toString(moduleNode.getProperty(HCM_MODULE_SEQUENCE).getDouble()); } else { return null; } }
/** * Tests if adding a property with <code>Node.setProperty(String, * double)</code> works with <code>Session.save()</code> */ public void testNewDoublePropertySession() throws Exception { testNode.setProperty(propertyName1, d1); superuser.save(); assertEquals("Setting property with Node.setProperty(String, double) and Session.save() not working", new Double(d1), new Double(testNode.getProperty(propertyName1).getDouble())); }
@Override public double getDouble() throws ValueFormatException, RepositoryException { return getWrappedProperty().getDouble(); }
/** * Tests if adding a property with <code>Node.setProperty(String, * double)</code> works with <code>parentNode.save()</code> */ public void testNewDoublePropertyParent() throws Exception { testNode.setProperty(propertyName1, d1); testRootNode.getSession().save(); assertEquals("Setting property with Node.setProperty(String, double) and parentNode.save() not working", new Double(d1), new Double(testNode.getProperty(propertyName1).getDouble())); }
/** * Tests if modifying a property with <code>Node.setProperty(String, * double)</code> works with <code>Session.save()</code> */ public void testModifyDoublePropertySession() throws Exception { testNode.setProperty(propertyName1, d1); superuser.save(); testNode.setProperty(propertyName1, d2); superuser.save(); assertEquals("Modifying property with Node.setProperty(String, double) and Session.save() not working", new Double(d2), new Double(testNode.getProperty(propertyName1).getDouble())); }
public Double execute() throws Exception { return getDelegate().getDouble(); } });
/** * Tests if modifying a property with <code>Node.setProperty(String, * double)</code> works with <code>parentNode.save()</code> */ public void testModifyDoublePropertyParent() throws Exception { testNode.setProperty(propertyName1, d1); testRootNode.getSession().save(); testNode.setProperty(propertyName1, d2); testRootNode.getSession().save(); assertEquals("Modifying property with Node.setProperty(String, double) and parentNode.save() not working", new Double(d2), new Double(testNode.getProperty(propertyName1).getDouble())); }
/** * Tests that in infinity and NaN values can be persisted and round-tripped. */ public void testEdgeCases() throws Exception { double tests[] = { Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY }; String path = testNode.getPath(); for (double v : tests) { testNode.setProperty(propertyName1, v); testRootNode.getSession().save(); assertEquals("Round-trip of " + v, v, superuser.getNode(path).getProperty(propertyName1).getDouble()); } } }
public double getDoubleProperty(String name) { try { final Property property = getJCRProperty(name); if (property != null) { return property.getDouble(); } } catch (RepositoryException re) { log.error(re.getMessage(), re); } return 0d; }
public Double getDoubleProperty(final Node node, final String name, final Double defaultValue) { try { return node.getProperty(name).getDouble(); } catch (final PathNotFoundException e) { return defaultValue; } catch (final RepositoryException e) { throw new RepositoryAccessException(e.getMessage(), e); } }
@Override public double getDouble(String key, double defaultValue) throws StringValueConversionException { try { Property property = getProperty(key); if (property != null) { return property.getDouble(); } } catch (RepositoryException ex) { log.error(ex.getMessage()); } return defaultValue; }
@Override public double getDouble() { if (isExist()) { try { return getJCRProperty().getDouble(); } catch (RepositoryException e) { throw new RuntimeException("Can't read value of nodedata " + toString(), e); } } return 0; }
public double getDouble(Property property) throws RepositoryException { if (getPrevious() != null) { return getPrevious().getDouble(property); } else { return property.getDouble(); } }
@Test public void setPropertyToDouble() throws Exception { // GIVEN final Object value = Double.valueOf("42.195"); PropertyUtil.setProperty(root, PROPERTY_NAME, value); // WHEN double res = root.getProperty(PROPERTY_NAME).getDouble(); // THEN assertEquals(value, res); }
@Test public void setDoubleNaNProperty() throws RepositoryException, IOException { Node parentNode = getNode(TEST_PATH); addProperty(parentNode, "NaN", getAdminSession().getValueFactory().createValue(Double.NaN)); Session session2 = createAnonymousSession(); try { Property property2 = session2.getProperty(TEST_PATH + "/NaN"); assertTrue(Double.isNaN(property2.getDouble())); } finally { session2.logout(); } }