/** * Replace an existing child resource with a newly supplied one. * * @param replacedResource old resource to be replaced. * @param newResource new resource to add. * @throws java.lang.IllegalArgumentException in case there is no such child resource to be replaced. * @since 2.18 */ public void replaceChildResource(Resource replacedResource, Resource newResource) { final boolean removed = this.childResources.remove(replacedResource.data); if (!removed) { throw new IllegalArgumentException( LocalizationMessages.RESOURCE_REPLACED_CHILD_DOES_NOT_EXIST(replacedResource.toString())); } addChildResource(newResource); }
/** * Replace an existing child resource with a newly supplied one. * * @param replacedResource old resource to be replaced. * @param newResource new resource to add. * @throws java.lang.IllegalArgumentException in case there is no such child resource to be replaced. * @since 2.18 */ public void replaceChildResource(Resource replacedResource, Resource newResource) { final boolean removed = this.childResources.remove(replacedResource.data); if (!removed) { throw new IllegalArgumentException( LocalizationMessages.RESOURCE_REPLACED_CHILD_DOES_NOT_EXIST(replacedResource.toString())); } addChildResource(newResource); }
/** * Replace an existing child resource with a newly supplied one. * * @param replacedResource old resource to be replaced. * @param newResource new resource to add. * @throws java.lang.IllegalArgumentException in case there is no such child resource to be replaced. * @since 2.18 */ public void replaceChildResource(Resource replacedResource, Resource newResource) { final boolean removed = this.childResources.remove(replacedResource.data); if (!removed) { throw new IllegalArgumentException( LocalizationMessages.RESOURCE_REPLACED_CHILD_DOES_NOT_EXIST(replacedResource.toString())); } addChildResource(newResource); }
/** * Replace an existing child resource with a newly supplied one. * * @param replacedResource old resource to be replaced. * @param newResource new resource to add. * @throws java.lang.IllegalArgumentException in case there is no such child resource to be replaced. * @since 2.18 */ public void replaceChildResource(Resource replacedResource, Resource newResource) { final boolean removed = this.childResources.remove(replacedResource.data); if (!removed) { throw new IllegalArgumentException( LocalizationMessages.RESOURCE_REPLACED_CHILD_DOES_NOT_EXIST(replacedResource.toString())); } addChildResource(newResource); }
/** * Replace an existing child resource with a newly supplied one. * * @param replacedResource old resource to be replaced. * @param newResource new resource to add. * @throws java.lang.IllegalArgumentException in case there is no such child resource to be replaced. * @since 2.18 */ public void replaceChildResource(Resource replacedResource, Resource newResource) { final boolean removed = this.childResources.remove(replacedResource.data); if (!removed) { throw new IllegalArgumentException( LocalizationMessages.RESOURCE_REPLACED_CHILD_DOES_NOT_EXIST(replacedResource.toString())); } addChildResource(newResource); }
/** * Replace an existing child resource with a newly supplied one. * * @param replacedResource old resource to be replaced. * @param newResource new resource to add. * @throws java.lang.IllegalArgumentException in case there is no such child resource to be replaced. * @since 2.18 */ public void replaceChildResource(Resource replacedResource, Resource newResource) { final boolean removed = this.childResources.remove(replacedResource.data); if (!removed) { throw new IllegalArgumentException( LocalizationMessages.RESOURCE_REPLACED_CHILD_DOES_NOT_EXIST(replacedResource.toString())); } addChildResource(newResource); }
/** * Replace an existing child resource with a newly supplied one. * * @param replacedResource old resource to be replaced. * @param newResource new resource to add. * @throws java.lang.IllegalArgumentException in case there is no such child resource to be replaced. * @since 2.18 */ public void replaceChildResource(Resource replacedResource, Resource newResource) { final boolean removed = this.childResources.remove(replacedResource.data); if (!removed) { throw new IllegalArgumentException( LocalizationMessages.RESOURCE_REPLACED_CHILD_DOES_NOT_EXIST(replacedResource.toString())); } addChildResource(newResource); }