/** * Retrieves the element addressed by the URL. * * @param url * The URL of the element to retrieve. * <br>If <jk>null</jk> or blank, returns the root. * @param defVal The default value if the map doesn't contain the specified mapping. * @return The addressed element, or null if that element does not exist in the tree. */ public Object getWithDefault(String url, Object defVal) { Object o = service(GET, url, null); return o == null ? defVal : o; }
/** * Retrieves the element addressed by the URL. * * @param url * The URL of the element to retrieve. * <br>If <jk>null</jk> or blank, returns the root. * @param defVal The default value if the map doesn't contain the specified mapping. * @return The addressed element, or null if that element does not exist in the tree. */ public Object getWithDefault(String url, Object defVal) { Object o = service(GET, url, null); return o == null ? defVal : o; }
/** * Retrieves the element addressed by the URL. * * @param url * The URL of the element to retrieve. * <br>If <jk>null</jk> or blank, returns the root. * @param defVal The default value if the map doesn't contain the specified mapping. * @return The addressed element, or null if that element does not exist in the tree. */ public Object getWithDefault(String url, Object defVal) { Object o = service(GET, url, null); return o == null ? defVal : o; }
/** * Remove an element from a POJO model. * * <p> * If the element does not exist, no action is taken. * * @param url * The URL of the element being deleted. * If <jk>null</jk> or blank, the root itself is deleted. * @return The removed element, or null if that element does not exist. */ public Object delete(String url) { return service(DELETE, url, null); }
/** * Remove an element from a POJO model. * * <p> * If the element does not exist, no action is taken. * * @param url * The URL of the element being deleted. * If <jk>null</jk> or blank, the root itself is deleted. * @return The removed element, or null if that element does not exist. */ public Object delete(String url) { return service(DELETE, url, null); }
/** * Remove an element from a POJO model. * * <p> * If the element does not exist, no action is taken. * * @param url * The URL of the element being deleted. * If <jk>null</jk> or blank, the root itself is deleted. * @return The removed element, or null if that element does not exist. */ public Object delete(String url) { return service(DELETE, url, null); }
/** * Sets/replaces the element addressed by the URL. * * <p> * This method expands the POJO model as necessary to create the new element. * * @param url * The URL of the element to create. * If <jk>null</jk> or blank, the root itself is replaced with the specified value. * @param val The value being set. Value can be of any type. * @return The previously addressed element, or <jk>null</jk> the element did not previously exist. */ public Object put(String url, Object val) { return service(PUT, url, val); }
/** * Sets/replaces the element addressed by the URL. * * <p> * This method expands the POJO model as necessary to create the new element. * * @param url * The URL of the element to create. * If <jk>null</jk> or blank, the root itself is replaced with the specified value. * @param val The value being set. Value can be of any type. * @return The previously addressed element, or <jk>null</jk> the element did not previously exist. */ public Object put(String url, Object val) { return service(PUT, url, val); }
/** * Sets/replaces the element addressed by the URL. * * <p> * This method expands the POJO model as necessary to create the new element. * * @param url * The URL of the element to create. * If <jk>null</jk> or blank, the root itself is replaced with the specified value. * @param val The value being set. Value can be of any type. * @return The previously addressed element, or <jk>null</jk> the element did not previously exist. */ public Object put(String url, Object val) { return service(PUT, url, val); }
return (String)service(POST, url, val);
return (String)service(POST, url, val);
return (String)service(POST, url, val);
/** * Same as {@link #get(String, Class)} but returns a default value if the addressed element is null or non-existent. * * @param url * The URL of the element to retrieve. * If <jk>null</jk> or blank, returns the root. * @param def The default value if addressed item does not exist. * @param type The specified object type. * * @param <T> The specified object type. * @return The addressed element, or null if that element does not exist in the tree. */ public <T> T getWithDefault(String url, T def, Class<T> type) { Object o = service(GET, url, null); if (o == null) return def; return session.convertToType(o, type); }
/** * Same as {@link #get(String, Class)} but returns a default value if the addressed element is null or non-existent. * * @param url * The URL of the element to retrieve. * If <jk>null</jk> or blank, returns the root. * @param def The default value if addressed item does not exist. * @param type The specified object type. * * @param <T> The specified object type. * @return The addressed element, or null if that element does not exist in the tree. */ public <T> T getWithDefault(String url, T def, Class<T> type) { Object o = service(GET, url, null); if (o == null) return def; return session.convertToType(o, type); }
/** * Same as {@link #get(String, Class)} but returns a default value if the addressed element is null or non-existent. * * @param url * The URL of the element to retrieve. * If <jk>null</jk> or blank, returns the root. * @param def The default value if addressed item does not exist. * @param type The specified object type. * * @param <T> The specified object type. * @return The addressed element, or null if that element does not exist in the tree. */ public <T> T getWithDefault(String url, T def, Class<T> type) { Object o = service(GET, url, null); if (o == null) return def; return session.convertToType(o, type); }
/** * Same as {@link #get(String,Type,Type[])} but returns a default value if the addressed element is null or non-existent. * * @param url * The URL of the element to retrieve. * If <jk>null</jk> or blank, returns the root. * @param def The default value if addressed item does not exist. * @param type The specified object type. * @param args The specified object parameter types. * * @param <T> The specified object type. * @return The addressed element, or null if that element does not exist in the tree. */ public <T> T getWithDefault(String url, T def, Type type, Type...args) { Object o = service(GET, url, null); if (o == null) return def; return session.convertToType(o, type, args); }
/** * Same as {@link #get(String,Type,Type[])} but returns a default value if the addressed element is null or non-existent. * * @param url * The URL of the element to retrieve. * If <jk>null</jk> or blank, returns the root. * @param def The default value if addressed item does not exist. * @param type The specified object type. * @param args The specified object parameter types. * * @param <T> The specified object type. * @return The addressed element, or null if that element does not exist in the tree. */ public <T> T getWithDefault(String url, T def, Type type, Type...args) { Object o = service(GET, url, null); if (o == null) return def; return session.convertToType(o, type, args); }
/** * Same as {@link #get(String,Type,Type[])} but returns a default value if the addressed element is null or non-existent. * * @param url * The URL of the element to retrieve. * If <jk>null</jk> or blank, returns the root. * @param def The default value if addressed item does not exist. * @param type The specified object type. * @param args The specified object parameter types. * * @param <T> The specified object type. * @return The addressed element, or null if that element does not exist in the tree. */ public <T> T getWithDefault(String url, T def, Type type, Type...args) { Object o = service(GET, url, null); if (o == null) return def; return session.convertToType(o, type, args); }