
org.signal.libsignal.zkgroup.backups.BackupLevel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of libsignal-server Show documentation
Show all versions of libsignal-server Show documentation
Signal Protocol cryptography library for Java (server-side)
//
// Copyright 2024 Signal Messenger, LLC.
// SPDX-License-Identifier: AGPL-3.0-only
//
package org.signal.libsignal.zkgroup.backups;
public enum BackupLevel {
// This must match the Rust version of the enum.
FREE(200),
PAID(201);
private final int value;
BackupLevel(int value) {
this.value = value;
}
int getValue() {
return this.value;
}
public static BackupLevel fromValue(int value) {
// A linear scan is simpler than a hash lookup for a set of values this small.
for (final var backupLevel : BackupLevel.values()) {
if (backupLevel.getValue() == value) {
return backupLevel;
}
}
throw new IllegalArgumentException("Invalid backup level: " + value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy