@Override public BigDecimal getDecimal() throws RepositoryException { return delegate.getDecimal(); }
public BigDecimal getDecimal() throws ValueFormatException, RepositoryException { return property.getDecimal(); }
public BigDecimal getDecimal() throws RepositoryException { return this.item.getDecimal(); }
/** * Returns the decimal property value at <code>relPath</code> from <code>baseNode</code> or <code>defaultValue</code> * if no such property exists. * * @param baseNode existing node that should be the base for the relative path * @param relPath relative path to the property to get * @param defaultValue default value to return when the property does not exist * @return the decimal property value at <code>relPath</code> from <code>baseNode</code> or <code>defaultValue</code> * if no such property exists * @throws RepositoryException in case of exception accessing the Repository */ public static BigDecimal getDecimalProperty(Node baseNode, String relPath, BigDecimal defaultValue) throws RepositoryException { try { return baseNode.getProperty(relPath).getDecimal(); } catch (PathNotFoundException e) { return defaultValue; } }
/** * Returns the decimal property value at <code>relPath</code> from <code>baseNode</code> or * <code>defaultValue</code> if no such property exists. * * @param baseNode existing node that should be the base for the relative path * @param relPath relative path to the property to get * @param defaultValue default value to return when the property does not exist * @return the decimal property value at <code>relPath</code> from <code>baseNode</code> or * <code>defaultValue</code> if no such property exists * @throws RepositoryException in case of exception accessing the Repository */ public static BigDecimal getDecimalProperty(Node baseNode, String relPath, BigDecimal defaultValue) throws RepositoryException { try { return baseNode.getProperty(relPath).getDecimal(); } catch (PathNotFoundException e) { return defaultValue; } }
/** * Returns the decimal property value at <code>relPath</code> from <code>baseNode</code> or <code>defaultValue</code> * if no such property exists. * * @param baseNode existing node that should be the base for the relative path * @param relPath relative path to the property to get * @param defaultValue default value to return when the property does not exist * @return the decimal property value at <code>relPath</code> from <code>baseNode</code> or <code>defaultValue</code> * if no such property exists * @throws RepositoryException in case of exception accessing the Repository */ public static BigDecimal getDecimalProperty(Node baseNode, String relPath, BigDecimal defaultValue) throws RepositoryException { try { return baseNode.getProperty(relPath).getDecimal(); } catch (PathNotFoundException e) { return defaultValue; } }
/** * Returns the decimal property value at <code>relPath</code> from <code>baseNode</code> or <code>defaultValue</code> * if no such property exists. * * @param baseNode existing node that should be the base for the relative path * @param relPath relative path to the property to get * @param defaultValue default value to return when the property does not exist * @return the decimal property value at <code>relPath</code> from <code>baseNode</code> or <code>defaultValue</code> * if no such property exists * @throws RepositoryException in case of exception accessing the Repository */ public static BigDecimal getDecimalProperty(Node baseNode, String relPath, BigDecimal defaultValue) throws RepositoryException { try { return baseNode.getProperty(relPath).getDecimal(); } catch (PathNotFoundException e) { return defaultValue; } }
@Override public BigDecimal getDecimal() throws ValueFormatException, RepositoryException { return getWrappedProperty().getDecimal(); }
/** * Tests if adding a property with <code>Node.setProperty(String, * BigDecimal)</code> works with <code>Session.save()</code> */ public void testNewDecimalPropertySession() throws Exception { testNode.setProperty(propertyName1, b1); superuser.save(); assertEquals("Setting property with Node.setProperty(String, double) and Session.save() not working", b1, testNode.getProperty(propertyName1).getDecimal()); }
/** * Tests if modifying a property with <code>Node.setProperty(String, * BigDecimal)</code> works with <code>Session.save()</code> */ public void testModifyDecimalPropertySession() throws Exception { testNode.setProperty(propertyName1, b1); superuser.save(); testNode.setProperty(propertyName1, b2); superuser.save(); assertEquals("Modifying property with Node.setProperty(String, double) and Session.save() not working", b2, testNode.getProperty(propertyName1).getDecimal()); }
public BigDecimal execute() throws Exception { return getDelegate().getDecimal(); } });
/** * Returns the decimal property value at <code>absPath</code> or <code>defaultValue</code> if no such property * exists. * * @param session to use * @param absPath absolute path to the property to get * @param defaultValue default value to return when the property does not exist * @return the decimal property value at <code>absPath</code> or <code>defaultValue</code> if no such property * exists * @throws RepositoryException in case of exception accessing the Repository */ public static BigDecimal getDecimalProperty(Session session, String absPath, BigDecimal defaultValue) throws RepositoryException { try { return session.getProperty(absPath).getDecimal(); } catch (PathNotFoundException e) { return defaultValue; } }
/** * Returns the decimal property value at <code>absPath</code> or <code>defaultValue</code> * if no such property exists. * * @param session to use * @param absPath absolute path to the property to get * @param defaultValue default value to return when the property does not exist * @return the decimal property value at <code>absPath</code> or <code>defaultValue</code> * if no such property exists * @throws RepositoryException in case of exception accessing the Repository */ public static BigDecimal getDecimalProperty(Session session, String absPath, BigDecimal defaultValue) throws RepositoryException { try { return session.getProperty(absPath).getDecimal(); } catch (PathNotFoundException e) { return defaultValue; } }
/** * Returns the decimal property value at <code>absPath</code> or <code>defaultValue</code> * if no such property exists. * * @param session to use * @param absPath absolute path to the property to get * @param defaultValue default value to return when the property does not exist * @return the decimal property value at <code>absPath</code> or <code>defaultValue</code> * if no such property exists * @throws RepositoryException in case of exception accessing the Repository */ public static BigDecimal getDecimalProperty(Session session, String absPath, BigDecimal defaultValue) throws RepositoryException { try { return session.getProperty(absPath).getDecimal(); } catch (PathNotFoundException e) { return defaultValue; } }
/** * Returns the decimal property value at <code>absPath</code> or <code>defaultValue</code> * if no such property exists. * * @param session to use * @param absPath absolute path to the property to get * @param defaultValue default value to return when the property does not exist * @return the decimal property value at <code>absPath</code> or <code>defaultValue</code> * if no such property exists * @throws RepositoryException in case of exception accessing the Repository */ public static BigDecimal getDecimalProperty(Session session, String absPath, BigDecimal defaultValue) throws RepositoryException { try { return session.getProperty(absPath).getDecimal(); } catch (PathNotFoundException e) { return defaultValue; } }
public BigDecimal getBigDecimalProperty(final Node node, final String name, final BigDecimal defaultValue) { try { return node.getProperty(name).getDecimal(); } catch (final PathNotFoundException e) { return defaultValue; } catch (final RepositoryException e) { throw new RepositoryAccessException(e.getMessage(), e); } }
public BigDecimal getDecimal(Property property) throws RepositoryException { if (getPrevious() != null) { return getPrevious().getDecimal(property); } else { return property.getDecimal(); } }
@Test public void testSetValueWithBigDecimal() throws Exception { MockNode node = new MockNode("parent"); Property property = new MockProperty("test", BigDecimal.valueOf(0), node); property.setValue(BigDecimal.ONE); assertEquals(BigDecimal.ONE, property.getDecimal()); }
@Test public void setPropertyToBigDecimal() throws Exception { // GIVEN final Object value = BigDecimal.ONE; PropertyUtil.setProperty(root, PROPERTY_NAME, value); // WHEN BigDecimal res = root.getProperty(PROPERTY_NAME).getDecimal(); // THEN assertEquals(value, res); }
@Test public void testGetProperties() throws Exception { root.setProperty("property1", "string"); root.setProperty("property2", BigDecimal.TEN); PropertyIterator iterator = root.getProperties(); assertTrue(iterator.hasNext()); Property current = iterator.nextProperty(); assertEquals("property1", current.getName()); assertEquals("string", current.getString()); current = iterator.nextProperty(); assertEquals("property2", current.getName()); assertEquals(BigDecimal.TEN, current.getDecimal()); assertTrue(!iterator.hasNext()); }