/** * Similar to {@link #remove(int) remove(int)},but the key is a slash-delimited path used to traverse entries in * this POJO. * * <p> * For example, the following code is equivalent: * </p> * <p class='bcode w800'> * ObjectMap m = getObjectMap(); * * <jc>// Long way</jc> * m.getObjectMap(<js>"foo"</js>).getObjectList(<js>"bar"</js>).getObjectMap(1).remove(<js>"baz"</js>); * * <jc>// Using this method</jc> * m.deleteAt(<js>"foo/bar/0/baz"</js>); * </p> * * <p> * This method uses the {@link PojoRest} class to perform the lookup, so the map can contain any of the various * class types that the {@link PojoRest} class supports (e.g. beans, collections, arrays). * * @param path The path to the entry. * @return The previous value, or <jk>null</jk> if the entry doesn't exist. */ public Object deleteAt(String path) { return getPojoRest().delete(path); }
/** * Similar to {@link #remove(Object) remove(Object)}, but the key is a slash-delimited path used to traverse entries * in this POJO. * * <p> * For example, the following code is equivalent: * </p> * <p class='bcode w800'> * ObjectMap m = getObjectMap(); * * <jc>// Long way</jc> * m.getObjectMap(<js>"foo"</js>).getObjectList(<js>"bar"</js>).getObjectMap(0).remove(<js>"baz"</js>); * * <jc>// Using this method</jc> * m.deleteAt(<js>"foo/bar/0/baz"</js>); * </p> * * <p> * This method uses the {@link PojoRest} class to perform the lookup, so the map can contain any of the various * class types that the {@link PojoRest} class supports (e.g. beans, collections, arrays). * * @param path The path to the entry. * @return The previous value, or <jk>null</jk> if the entry doesn't exist. */ public Object deleteAt(String path) { return getPojoRest().delete(path); }
/** * Similar to {@link #remove(int) remove(int)},but the key is a slash-delimited path used to traverse entries in * this POJO. * * <p> * For example, the following code is equivalent: * </p> * <p class='bcode w800'> * ObjectMap m = getObjectMap(); * * <jc>// Long way</jc> * m.getObjectMap(<js>"foo"</js>).getObjectList(<js>"bar"</js>).getObjectMap(1).remove(<js>"baz"</js>); * * <jc>// Using this method</jc> * m.deleteAt(<js>"foo/bar/0/baz"</js>); * </p> * * <p> * This method uses the {@link PojoRest} class to perform the lookup, so the map can contain any of the various * class types that the {@link PojoRest} class supports (e.g. beans, collections, arrays). * * @param path The path to the entry. * @return The previous value, or <jk>null</jk> if the entry doesn't exist. */ public Object deleteAt(String path) { return getPojoRest().delete(path); }
/** * Similar to {@link #remove(Object) remove(Object)}, but the key is a slash-delimited path used to traverse entries * in this POJO. * * <p> * For example, the following code is equivalent: * </p> * <p class='bcode w800'> * ObjectMap m = getObjectMap(); * * <jc>// Long way</jc> * m.getObjectMap(<js>"foo"</js>).getObjectList(<js>"bar"</js>).getObjectMap(0).remove(<js>"baz"</js>); * * <jc>// Using this method</jc> * m.deleteAt(<js>"foo/bar/0/baz"</js>); * </p> * * <p> * This method uses the {@link PojoRest} class to perform the lookup, so the map can contain any of the various * class types that the {@link PojoRest} class supports (e.g. beans, collections, arrays). * * @param path The path to the entry. * @return The previous value, or <jk>null</jk> if the entry doesn't exist. */ public Object deleteAt(String path) { return getPojoRest().delete(path); }
/** * Similar to {@link #remove(int) remove(int)},but the key is a slash-delimited path used to traverse entries in * this POJO. * * <p> * For example, the following code is equivalent: * </p> * <p class='bcode w800'> * ObjectMap m = getObjectMap(); * * <jc>// Long way</jc> * m.getObjectMap(<js>"foo"</js>).getObjectList(<js>"bar"</js>).getObjectMap(1).remove(<js>"baz"</js>); * * <jc>// Using this method</jc> * m.deleteAt(<js>"foo/bar/0/baz"</js>); * </p> * * <p> * This method uses the {@link PojoRest} class to perform the lookup, so the map can contain any of the various * class types that the {@link PojoRest} class supports (e.g. beans, collections, arrays). * * @param path The path to the entry. * @return The previous value, or <jk>null</jk> if the entry doesn't exist. */ public Object deleteAt(String path) { return getPojoRest().delete(path); }
/** * Similar to {@link #remove(Object) remove(Object)}, but the key is a slash-delimited path used to traverse entries * in this POJO. * * <p> * For example, the following code is equivalent: * </p> * <p class='bcode w800'> * ObjectMap m = getObjectMap(); * * <jc>// Long way</jc> * m.getObjectMap(<js>"foo"</js>).getObjectList(<js>"bar"</js>).getObjectMap(0).remove(<js>"baz"</js>); * * <jc>// Using this method</jc> * m.deleteAt(<js>"foo/bar/0/baz"</js>); * </p> * * <p> * This method uses the {@link PojoRest} class to perform the lookup, so the map can contain any of the various * class types that the {@link PojoRest} class supports (e.g. beans, collections, arrays). * * @param path The path to the entry. * @return The previous value, or <jk>null</jk> if the entry doesn't exist. */ public Object deleteAt(String path) { return getPojoRest().delete(path); }
model.delete("addresses/1"); s = serializer.serialize(p); expectedValue = "{name:'some name',age:123,addresses:[{street:'street D',city:'city D',state:'state D',zip:12345,isCurrent:false},{street:'street F',city:'city F',state:'state F',zip:12345,isCurrent:false}]}"; assertEquals(expectedValue, s); model.delete("addresses/0"); model.delete("addresses/0"); s = serializer.serialize(p); expectedValue = "{name:'some name',age:123,addresses:[]}";