/** * Converts a given {@link Boundary} to its binary representation suitable for {@literal ZRANGEBY*} commands, despite * {@literal ZRANGEBYLEX}. * * @param boundary * @param defaultValue * @return * @since 1.6 */ public static byte[] boundaryToBytesForZRange(@Nullable Boundary boundary, byte[] defaultValue) { if (boundary == null || boundary.getValue() == null) { return defaultValue; } return boundaryToBytes(boundary, new byte[] {}, toBytes("(")); }
/** * Converts a given {@link Boundary} to its binary representation suitable for ZRANGEBYLEX command. * * @param boundary * @return * @since 1.6 */ public static byte[] boundaryToBytesForZRangeByLex(@Nullable Boundary boundary, byte[] defaultValue) { if (boundary == null || boundary.getValue() == null) { return defaultValue; } return boundaryToBytes(boundary, toBytes("["), toBytes("(")); }
/** * Converts a given {@link Boundary} to its binary representation suitable for {@literal ZRANGEBY*} commands, despite * {@literal ZRANGEBYLEX}. * * @param boundary * @param defaultValue * @return * @since 1.6 */ public static byte[] boundaryToBytesForZRange(@Nullable Boundary boundary, byte[] defaultValue) { if (boundary == null || boundary.getValue() == null) { return defaultValue; } return boundaryToBytes(boundary, new byte[] {}, toBytes("(")); }
/** * Converts a given {@link Boundary} to its binary representation suitable for {@literal ZRANGEBY*} commands, despite * {@literal ZRANGEBYLEX}. * * @param boundary * @param defaultValue * @return * @since 1.6 */ public static byte[] boundaryToBytesForZRange(@Nullable Boundary boundary, byte[] defaultValue) { if (boundary == null || boundary.getValue() == null) { return defaultValue; } return boundaryToBytes(boundary, new byte[] {}, toBytes("(")); }
/** * Converts a given {@link Boundary} to its binary representation suitable for ZRANGEBYLEX command. * * @param boundary * @return * @since 1.6 */ public static byte[] boundaryToBytesForZRangeByLex(@Nullable Boundary boundary, byte[] defaultValue) { if (boundary == null || boundary.getValue() == null) { return defaultValue; } return boundaryToBytes(boundary, toBytes("["), toBytes("(")); }
/** * Converts a given {@link Boundary} to its binary representation suitable for ZRANGEBYLEX command. * * @param boundary * @return * @since 1.6 */ public static byte[] boundaryToBytesForZRangeByLex(@Nullable Boundary boundary, byte[] defaultValue) { if (boundary == null || boundary.getValue() == null) { return defaultValue; } return boundaryToBytes(boundary, toBytes("["), toBytes("(")); }