/** * Prepare for inline removal of an external child resource (along with the update of parent resource). * * @param name the name of the external child resource */ protected final void prepareInlineRemove(String name) { prepareInlineRemove(name, name); }
@Override public CreatedResources<T> call(CreatableUpdatableResourcesRoot<T> tCreatableUpdatableResourcesRoot) { return new CreatedResourcesImpl<>(tCreatableUpdatableResourcesRoot); } });
@Override public T call(InnerT inner) { return wrapModel(inner); } });
@Override public final Observable<Indexable> createAsync(List<Creatable<T>> creatables) { CreatableUpdatableResourcesRootImpl<T> rootResource = new CreatableUpdatableResourcesRootImpl<>(); rootResource.addCreatableDependencies(creatables); return rootResource.createAsync(); }
/** * Converts the List to PagedList. * @param list list to be converted in to paged list * @param <InnerT> the wrapper inner type * @return the Paged list for the inner type. */ public static <InnerT> PagedList<InnerT> convertToPagedList(List<InnerT> list) { PageImpl<InnerT> page = new PageImpl<>(); page.setItems(list); page.setNextPageLink(null); return new PagedList<InnerT>(page) { @Override public Page<InnerT> nextPage(String nextPageLink) { return null; } }; }
protected Observable<T> wrapListAsync(Observable<List<InnerT>> innerList) { return wrapModelAsync(convertListToInnerAsync(innerList)); }
protected PagedList<T> wrapList(List<InnerT> list) { return wrapList(ReadableWrappersImpl.convertToPagedList(list)); }
protected Observable<T> wrapPageAsync(Observable<Page<InnerT>> innerPage) { return wrapModelAsync(convertPageToInnerAsync(innerPage)); }
/** * Prepare for inline definition of a new external child resource (along with the definition or update of parent resource). * * @param name the name for the new external child resource * @return the child resource */ protected FluentModelTImpl prepareInlineDefine(String name) { return prepareInlineDefine(name, name); }
/** * Prepare for inline update of an external child resource (along with the update of parent resource). * * @param name the name of the external child resource * @return the external child resource to be updated */ protected final FluentModelTImpl prepareInlineUpdate(String name) { return prepareInlineUpdate(name, name); }
@Override public T call(InnerT innerT) { return wrapModel(innerT); } });
/** * Refresh the child resource collection. */ public void refresh() { cacheCollection(); }
@Override public Observable<T> getByResourceGroupAsync(String resourceGroupName, String name) { return this.getInnerAsync(resourceGroupName, name).map(new Func1<InnerT, T>() { @Override public T call(InnerT innerT) { return wrapModel(innerT); } }); }
@Override public ServiceFuture<T> getByIdAsync(String id, ServiceCallback<T> callback) { return ServiceFuture.fromBody(getByIdAsync(id), callback); } }
@Override public ServiceFuture<Void> deleteByIdAsync(String id, ServiceCallback<Void> callback) { return ServiceFuture.fromBody(deleteByIdAsync(id), callback); } }
/** * Prepare for independent definition of a new external child resource (without the parent context). * * @param name the name of the new external child resource * @return the external child resource prepared for create */ protected final FluentModelTImpl prepareIndependentDefine(String name) { FluentModelTImpl childResource = newChildResource(name); childResource.setPendingOperation(ExternalChildResourceImpl.PendingOperation.ToBeCreated); return childResource; }
/** * Adds an external child resource to the childCollection. * * @param childResource the external child resource */ protected void addChildResource(FluentModelTImpl childResource) { this.addChildResource(childResource.name(), childResource); }
@Override public final Observable<T> getByIdAsync(String id) { ResourceId resourceId = ResourceId.fromString(id); if (resourceId == null) { return null; } return getByResourceGroupAsync(resourceId.resourceGroupName(), resourceId.name()); }
@Override public CreatedResources<T> call(CreatableUpdatableResourcesRoot<T> tCreatableUpdatableResourcesRoot) { return new CreatedResourcesImpl<>(tCreatableUpdatableResourcesRoot); } });
@Override public Observable<T> typeConvertAsync(InnerT inner) { return Observable.just((T) wrapModel(inner)); } };