本文整理汇总了Java中com.raizlabs.android.dbflow.runtime.transaction.process.ProcessModelInfo类的典型用法代码示例。如果您正苦于以下问题:Java ProcessModelInfo类的具体用法?Java ProcessModelInfo怎么用?Java ProcessModelInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProcessModelInfo类属于com.raizlabs.android.dbflow.runtime.transaction.process包,在下文中一共展示了ProcessModelInfo类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addNewMarketTypes
import com.raizlabs.android.dbflow.runtime.transaction.process.ProcessModelInfo; //导入依赖的package包/类
public static void addNewMarketTypes(List<CrestMarketType> types, BehaviorSubject<Map.Entry<Integer, Integer>> subject) {
int size = types.size();
List<MarketTypeEntry> entries = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
CrestMarketType type = types.get(i);
MarketTypeEntry entry = new MarketTypeEntry();
entry.id = type.getTypeId();
entry.groupId = type.getGroupId();
entry.href = type.getTypeHref();
entry.icon = type.getTypeIcon();
entry.name = type.getTypeName();
entries.add(entry);
}
TransactionManager manager = TransactionManager.getInstance();
ProcessModelTransaction transaction = new SaveModelTransaction<>(ProcessModelInfo.withModels(entries));
transaction.setChangeListener((current, maxProgress, modifiedModel) -> {
if (current % 25 == 0 || current == maxProgress) {
subject.onNext(new AbstractMap.SimpleEntry<>((int) current, (int) maxProgress));
}
});
manager.addTransaction(transaction);
}
示例2: addRegions
import com.raizlabs.android.dbflow.runtime.transaction.process.ProcessModelInfo; //导入依赖的package包/类
public static void addRegions(List<CrestItem> regions) {
int size = regions.size();
List<RegionEntry> entries = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
CrestItem region = regions.get(i);
RegionEntry entry = new RegionEntry();
entry.id = region.getId();
entry.name = region.getName();
entry.href = region.getHref();
entries.add(entry);
}
TransactionManager.getInstance().addTransaction(new SaveModelTransaction<>(
ProcessModelInfo.withModels(entries)));
}
示例3: addNewMarketGroups
import com.raizlabs.android.dbflow.runtime.transaction.process.ProcessModelInfo; //导入依赖的package包/类
public static void addNewMarketGroups(List<CrestMarketGroup> groups) {
int count = groups.size();
List<MarketGroupEntry> entries = new ArrayList<>(count);
for (int i = 0; i < count; i++) {
CrestMarketGroup group = groups.get(i);
MarketGroupEntry entry = new MarketGroupEntry();
entry.id = group.getId();
entry.description = group.getDescription();
entry.name = group.getName();
entry.href = group.getHref();
entry.parent = group.hasParent() ? group.getParentRef() : null;
entry.parentId = group.hasParent() ? group.getParentId() : null;
entry.types = group.getTypeRef();
entries.add(entry);
}
TransactionManager.getInstance().addTransaction(new SaveModelTransaction<>(
ProcessModelInfo.withModels(entries)));
}
示例4: saveBatch
import com.raizlabs.android.dbflow.runtime.transaction.process.ProcessModelInfo; //导入依赖的package包/类
public void saveBatch(){
//Save questions in batch
new SaveModelTransaction<>(ProcessModelInfo.withModels(questions)).onExecute();
//Refresh media references
List<Media> medias = questionBuilder.getListMedia();
for(Media media: medias){
media.updateQuestion();
}
//Save media in batch
new SaveModelTransaction<>(ProcessModelInfo.withModels(medias)).onExecute();
}