Class TupleRange

    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • isEquals

        public boolean isEquals()
      • prepend

        @Nonnull
        public TupleRange prepend​(@Nonnull
                                  Tuple beginning)
        Create a TupleRange over the same keys as this range but prepended by the supplied Tuple. For example, if this range is over all Tuples from ("a", 3) exclusive to ("b", 4) inclusive and one calls this method with (0, null) as the argument, this will create a range from (0, null, "a", 3) exclusive to (0, null, "b", 4) inclusive.
        Parameters:
        beginning - a Tuple to prepend to the beginning of this range
        Returns:
        a new TupleRange over all keys in this range but prepended with beginning
      • allOf

        @Nonnull
        public static TupleRange allOf​(@Nullable
                                       Tuple prefix)
        Create a TupleRange over all keys beginning with a given Tuple. This is a shortcut for creating a TupleRange with prefix as both the low- and high-endpoint and setting both endpoint types to RANGE_INCLUSIVE.
        Parameters:
        prefix - the Tuple all keys in the returned range should begin with
        Returns:
        a TupleRange corresponding to keys prefixed by prefix
      • between

        public static TupleRange between​(@Nullable
                                         Tuple low,
                                         @Nullable
                                         Tuple high)
        Create a TupleRange over all keys between the given Tuples.
        Parameters:
        low - the inclusive start of the range
        high - the exclusive end of the range
        Returns:
        a TupleRange between start and end
      • prefixedBy

        @Nonnull
        public static TupleRange prefixedBy​(@Nonnull
                                            String prefixString)
        Create a TupleRange over all keys prefixed by some String. This is a shortcut for creating a TupleRange where both the low- and high-endpoints are Tuples containing a single String where both the low and high endpoint types are PREFIX_STRING.
        Parameters:
        prefixString - the string that the keys in the returned range will have as a prefix
        Returns:
        a TupleRange corresponding to keys prefixed by prefixString
      • toRange

        @Nonnull
        public Range toRange()
        Convert into a FoundationDB Range. This behaves just like the version of toRange() that takes a Subspace, but this version does not prefix the resulting range with anything. If either endpoint is null, then the null endpoints will be replaced with byte arrays representing the beginning or ending of the user-readable keys in FoundationDB (that is, it will not include the system keyspace).
        Returns:
        a FoundationDB Range over the same keys as this TupleRange
      • toRange

        @Nonnull
        public Range toRange​(@Nonnull
                             Subspace subspace)
        Convert into a FoundationDB Range. This adjusts the endpoints of this TupleRange and creates a Range object that spans over the same range of keys. This range can be passed to Trasaction.getRange(), for example. As with all other ranges in FoundationDB, the resulting range will include its beginning endpoint but exclude its ending endpoint. The range produced will be prefixed by the Subspace provided.
        Parameters:
        subspace - the Subspace this range should be prefixed by
        Returns:
        a FoundationDB Range over the same keys as this TupleRange
      • toRange

        @Nonnull
        public static Range toRange​(@Nullable
                                    byte[] lowBytes,
                                    @Nullable
                                    byte[] highBytes,
                                    @Nonnull
                                    EndpointType lowEndpoint,
                                    @Nonnull
                                    EndpointType highEndpoint)
        Convert a pair of endpoints into a FoundationDB Range. If both lowBytes and highBytes could be unpacked into Tuples, this would be equivalent to unpacking them, creating a TupleRange object out of them, and then calling toRange() on the resulting TupleRange.
        Parameters:
        lowBytes - the beginning of the range
        highBytes - the end of the range
        lowEndpoint - the type (inclusive, exclusive, etc.) of the low endpoint
        highEndpoint - the type (inclusive, exclusive, etc.) of the high endpoint
        Returns:
        a FoundationDB Range over the same keys as the provided parameters