public static ImmutableList<QuotaByStorageTypeEntry> loadQuotaByStorageTypeEntries( QuotaByStorageTypeFeatureProto proto) { ImmutableList.Builder<QuotaByStorageTypeEntry> b = ImmutableList.builder(); for (QuotaByStorageTypeEntryProto quotaEntry : proto.getQuotasList()) { StorageType type = PBHelper.convertStorageType(quotaEntry.getStorageType()); long quota = quotaEntry.getQuota(); b.add(new QuotaByStorageTypeEntry.Builder().setStorageType(type) .setQuota(quota).build()); } return b.build(); }
private static QuotaByStorageTypeFeatureProto.Builder buildQuotaByStorageTypeEntries(QuotaCounts q) { QuotaByStorageTypeFeatureProto.Builder b = QuotaByStorageTypeFeatureProto.newBuilder(); for (StorageType t: StorageType.getTypesSupportingQuota()) { if (q.getTypeSpace(t) >= 0) { QuotaByStorageTypeEntryProto.Builder eb = QuotaByStorageTypeEntryProto.newBuilder(). setStorageType(PBHelper.convertStorageType(t)). setQuota(q.getTypeSpace(t)); b.addQuotas(eb); } } return b; }
public static ImmutableList<QuotaByStorageTypeEntry> loadQuotaByStorageTypeEntries( QuotaByStorageTypeFeatureProto proto) { ImmutableList.Builder<QuotaByStorageTypeEntry> b = ImmutableList.builder(); for (QuotaByStorageTypeEntryProto quotaEntry : proto.getQuotasList()) { StorageType type = PBHelperClient.convertStorageType(quotaEntry.getStorageType()); long quota = quotaEntry.getQuota(); b.add(new QuotaByStorageTypeEntry.Builder().setStorageType(type) .setQuota(quota).build()); } return b.build(); }
private static QuotaByStorageTypeFeatureProto.Builder buildQuotaByStorageTypeEntries(QuotaCounts q) { QuotaByStorageTypeFeatureProto.Builder b = QuotaByStorageTypeFeatureProto.newBuilder(); for (StorageType t: StorageType.getTypesSupportingQuota()) { if (q.getTypeSpace(t) >= 0) { QuotaByStorageTypeEntryProto.Builder eb = QuotaByStorageTypeEntryProto.newBuilder(). setStorageType(PBHelperClient.convertStorageType(t)). setQuota(q.getTypeSpace(t)); b.addQuotas(eb); } } return b; }