/** * Access a named property as a boolean. * * @param name * The property name. * @return the property value. * @exception EmptyException * if not found. * @exception TypeException * if the property is found but not a boolean. */ public boolean getBooleanProperty(String name) throws EntityPropertyNotDefinedException, EntityPropertyTypeException { String p = getProperty(name); if (p == null) throw new EntityPropertyNotDefinedException(); try { return Boolean.valueOf(p).booleanValue(); } catch (Exception any) { throw new EntityPropertyTypeException(name); } }
/** * Access a named property as a long. * * @param name * The property name. * @return the property value. * @exception EmptyException * if not found. * @exception TypeException * if the property is found but not a long. */ public long getLongProperty(String name) throws EntityPropertyNotDefinedException, EntityPropertyTypeException { String p = getProperty(name); if (p == null) throw new EntityPropertyNotDefinedException(); try { return Long.parseLong(p); } catch (Exception any) { throw new EntityPropertyTypeException(name); } }
/** * Access a named property as a Time. * * @param name * The property name. * @return the property value * @exception EmptyException * if not found. * @exception TypeException * if the property is found but not a Time. */ public Time getTimeProperty(String name) throws EntityPropertyNotDefinedException, EntityPropertyTypeException { String p = getProperty(name); if (p == null) throw new EntityPropertyNotDefinedException(); try { return TimeService.newTimeGmt(p); } catch (Exception any) { throw new EntityPropertyTypeException(name); } } // getTimeProperty
/** * Access a named property as a User. * * @param name * The property name. * @return the property value * @exception EmptyException * if not found. * @exception TypeException * if the property is found but not a User. */ public User getUserProperty(String name) throws EntityPropertyNotDefinedException, EntityPropertyTypeException { String p = getProperty(name); if (p == null) throw new EntityPropertyNotDefinedException(); try { return UserDirectoryService.getUser(p); } catch (Exception any) { throw new EntityPropertyTypeException(name); } }