diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/dynamic_property/calculator/AbstractEntityAdaptor.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/dynamic_property/calculator/AbstractEntityAdaptor.java index 28392e985a0702b15057159a00438a09ac1105a5..2b176434132d9a9dc5f05ee7f90f436c304f03d1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/dynamic_property/calculator/AbstractEntityAdaptor.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/dynamic_property/calculator/AbstractEntityAdaptor.java @@ -66,23 +66,23 @@ public class AbstractEntityAdaptor implements IEntityAdaptor propertiesByCode.put(property.getPropertyTypeCode(), property); } - public String getCode() + public String code() { return code; } - public IEntityPropertyAdaptor getPropertyByCode(String propertyTypeCode) + public IEntityPropertyAdaptor propertyByCode(String propertyTypeCode) { return propertiesByCode.get(propertyTypeCode); } - public String getPropertyValueByCode(String propertyTypeCode) + public String propertyValueByCode(String propertyTypeCode) { - final IEntityPropertyAdaptor propertyOrNull = getPropertyByCode(propertyTypeCode); + final IEntityPropertyAdaptor propertyOrNull = propertyByCode(propertyTypeCode); return propertyOrNull == null ? "" : propertyOrNull.getValueAsString(); } - public Collection<IEntityPropertyAdaptor> getProperties() + public Collection<IEntityPropertyAdaptor> properties() { return propertiesByCode.values(); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/dynamic_property/calculator/IEntityAdaptor.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/dynamic_property/calculator/IEntityAdaptor.java index aa5f2ad52621475c1bce7b8464f8a7ba6180288d..de8b0fa14e7314d79748f3e2a2f73dcd5ed2966e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/dynamic_property/calculator/IEntityAdaptor.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/dynamic_property/calculator/IEntityAdaptor.java @@ -25,19 +25,18 @@ import java.util.Collection; * * @author Piotr Buczek */ -// TODO 2010-10-15, Piotr Buczek: what naming convention should be used for DTOs used in Jython public interface IEntityAdaptor { /** Returns the code. */ - public String getCode(); + public String code(); /** Returns the property by code of the property type. */ - public IEntityPropertyAdaptor getPropertyByCode(String propertyTypeCode); + public IEntityPropertyAdaptor propertyByCode(String propertyTypeCode); /** Returns the property value by code of the property type. */ - public String getPropertyValueByCode(String propertyTypeCode); + public String propertyValueByCode(String propertyTypeCode); /** Returns collection of properties of the entity */ - public Collection<IEntityPropertyAdaptor> getProperties(); + public Collection<IEntityPropertyAdaptor> properties(); } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/dynamic_property/calculator/DynamicPropertyCalculatorTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/dynamic_property/calculator/DynamicPropertyCalculatorTest.java index 2fbdb461d99efd6f9acfe73f438a2dc4b0319e71..650a7f0d2171f46029140455a591db0730b97ca9 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/dynamic_property/calculator/DynamicPropertyCalculatorTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/dynamic_property/calculator/DynamicPropertyCalculatorTest.java @@ -22,7 +22,6 @@ import java.util.Collection; import org.testng.AssertJUnit; import org.testng.annotations.Test; - /** * @author Piotr Buczek */ @@ -34,8 +33,7 @@ public class DynamicPropertyCalculatorTest extends AssertJUnit { final String entityCode1 = "ecode1"; final String entityCode2 = "ecode2"; - final DynamicPropertyCalculator calculator = - new DynamicPropertyCalculator("entity.getCode()"); + final DynamicPropertyCalculator calculator = new DynamicPropertyCalculator("entity.code()"); calculator.setEntity(createEntity(entityCode1, null)); assertEquals(entityCode1, calculator.evalAsString()); @@ -48,7 +46,7 @@ public class DynamicPropertyCalculatorTest extends AssertJUnit public void testGetEntityPropertyValue() { final DynamicPropertyCalculator calculator = - new DynamicPropertyCalculator("entity.getPropertyValueByCode('p2')"); + new DynamicPropertyCalculator("entity.propertyValueByCode('p2')"); final String entityCode = "ecode";