org.whispersystems.util.FlagUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of signal-service-java Show documentation
Show all versions of signal-service-java Show documentation
Signal Service communication library for Java, unofficial fork
package org.whispersystems.util;
public final class FlagUtil {
private FlagUtil() {}
/**
* Left shift 1 by 'flag' - 1 spaces.
*
* Examples:
* 1 -> 0001
* 2 -> 0010
* 3 -> 0100
* 4 -> 1000
*/
public static int toBinaryFlag(int flag) {
return 1 << (flag - 1);
}
}