/** * Gets the value of a property. * * @param propertyDefinition The property to get or set. * @return An object representing the value of the property. * @throws ServiceLocalException ServiceVersionException will be raised if this property * requires a later version of Exchange. * ServiceObjectPropertyException will be raised for get if * property hasn't been assigned or loaded, raised for set if * property cannot be updated or deleted. */ public <T> T getObjectFromPropertyDefinition(PropertyDefinition propertyDefinition) throws ServiceLocalException { OutParam<ServiceLocalException> serviceExceptionOut = new OutParam<ServiceLocalException>(); T propertyValue = getPropertyValueOrException(propertyDefinition, serviceExceptionOut); ServiceLocalException serviceException = serviceExceptionOut.getParam(); if (serviceException != null) { throw serviceException; } return propertyValue; }
/** * Tries to get a property value based on a property definition. * * @param propertyDefinition The property definition. * @param propertyValueOutParam The property value. * @return True if property was retrieved. */ protected boolean tryGetProperty(PropertyDefinition propertyDefinition, OutParam<Object> propertyValueOutParam) { OutParam<ServiceLocalException> serviceExceptionOutParam = new OutParam<ServiceLocalException>(); propertyValueOutParam.setParam(this.getPropertyValueOrException( propertyDefinition, serviceExceptionOutParam)); return serviceExceptionOutParam.getParam() == null; }
/** * Gets the value of a property. * * @param propertyDefinition The property to get or set. * @return An object representing the value of the property. * @throws ServiceLocalException ServiceVersionException will be raised if this property * requires a later version of Exchange. * ServiceObjectPropertyException will be raised for get if * property hasn't been assigned or loaded, raised for set if * property cannot be updated or deleted. */ public <T> T getObjectFromPropertyDefinition(PropertyDefinition propertyDefinition) throws ServiceLocalException { OutParam<ServiceLocalException> serviceExceptionOut = new OutParam<ServiceLocalException>(); T propertyValue = getPropertyValueOrException(propertyDefinition, serviceExceptionOut); ServiceLocalException serviceException = serviceExceptionOut.getParam(); if (serviceException != null) { throw serviceException; } return propertyValue; }
/** * Tries to get a property value based on a property definition. * * @param propertyDefinition The property definition. * @param propertyValueOutParam The property value. * @return True if property was retrieved. */ protected boolean tryGetProperty(PropertyDefinition propertyDefinition, OutParam<Object> propertyValueOutParam) { OutParam<ServiceLocalException> serviceExceptionOutParam = new OutParam<ServiceLocalException>(); propertyValueOutParam.setParam(this.getPropertyValueOrException( propertyDefinition, serviceExceptionOutParam)); return serviceExceptionOutParam.getParam() == null; }