/** * Tries to get the phone number associated with the specified key. * * @param key the key * @param outparam the outparam * @return true if the Dictionary contains a phone number associated with the specified key; * otherwise, false. */ public boolean tryGetValue(PhoneNumberKey key, OutParam<String> outparam) { PhoneNumberEntry entry = null; if (this.getEntries().containsKey(key)) { entry = this.getEntries().get(key); outparam.setParam(entry.getPhoneNumber()); return true; } else { outparam = null; return false; } }
/** * Try to get the value of a specified extended property in this instance. * * @param propertyDefinition the property definition * @param propertyValue the property value * @return true, if successful * @throws Exception the exception */ protected <T> boolean tryGetExtendedProperty( Class<T> cls, ExtendedPropertyDefinition propertyDefinition, OutParam<T> propertyValue) throws Exception { ExtendedPropertyCollection propertyCollection = this.getExtendedProperties(); if ((propertyCollection != null) && propertyCollection.tryGetValue(cls, propertyDefinition, propertyValue)) { return true; } else { propertyValue.setParam(null); return false; } }