public class LightIdUtil extends Object
| Constructor and Description |
|---|
LightIdUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
forceBlockBit(int count)
Force to use a different BIT_BLOCK layout than the LightId default
to adjust the Block and Sequence ratio
|
static void |
forceBlockFirst(boolean b)
Force to use `Block+Sequence` layout or `Sequence+Block` layout
|
static int |
getBlockBit()
get the bit count of Block
|
static int |
getBlockMax()
get the max value of Block
|
static int |
getSequenceBit()
get the bit count of Sequence
|
static long |
getSequenceMax()
get the max value of Sequence
|
static boolean |
isBlockFirst()
Whether to use `Block+Sequence` layout or `Sequence+Block` layout
|
static boolean |
isNone(@Nullable LightId id) |
static boolean |
isZero(@Nullable LightId id) |
static boolean |
isZeroSequence(@Nullable LightId id) |
static int |
sequenceInt(long lightId) |
static long |
sequenceLong(long lightId) |
static long |
sequenceOrElse(@Nullable LightId lightId,
long elze) |
static long |
toId(int block,
long sequence) |
static @NotNull LightId |
toLightId(long lightId) |
static LightId |
toLightId(@Nullable Long lightId) |
static boolean |
valid(@Nullable Integer block,
@Nullable Long sequence) |
static boolean |
valid(int block,
long sequence) |
static boolean |
valid(@Nullable LightId id) |
public static void forceBlockBit(int count)
count - bit count, should be in [3-23]public static void forceBlockFirst(boolean b)
public static boolean isBlockFirst()
public static int getBlockBit()
public static int getBlockMax()
public static int getSequenceBit()
public static long getSequenceMax()
public static boolean valid(@Nullable
@Nullable LightId id)
public static boolean valid(@Nullable
@Nullable Integer block,
@Nullable
@Nullable Long sequence)
public static boolean valid(int block,
long sequence)
@NotNull public static @NotNull LightId toLightId(long lightId)
public static long toId(int block,
long sequence)
public static boolean isNone(@Nullable
@Nullable LightId id)
public static boolean isZero(@Nullable
@Nullable LightId id)
public static boolean isZeroSequence(@Nullable
@Nullable LightId id)
public static long sequenceOrElse(@Nullable
@Nullable LightId lightId,
long elze)
public static long sequenceLong(long lightId)
public static int sequenceInt(long lightId)
Copyright © 2023. All rights reserved.