本文整理匯總了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();
}