Class BigSegmentStoreTypes

  • public abstract class BigSegmentStoreTypes
    extends java.lang.Object
    Types that are used by the BigSegmentStore interface.
    • Method Detail

      • createMembershipFromSegmentRefs

        public static BigSegmentStoreTypes.Membership createMembershipFromSegmentRefs​(java.lang.Iterable<java.lang.String> includedSegmentRefs,
                                                                                      java.lang.Iterable<java.lang.String> excludedSegmentRefs)
        Convenience method for creating an implementation of BigSegmentStoreTypes.Membership.

        This method is intended to be used by Big Segment store implementations; application code does not need to use it.

        Store implementations are free to implement BigSegmentStoreTypes.Membership in any way that they find convenient and efficient, depending on what format they obtain values in from the database, but this method provides a simple way to do it as long as there are iterables of included and excluded segment references. As described in BigSegmentStoreTypes.Membership, a segmentRef is not the same as the key property in the segment data model; it includes the key but also versioning information that the SDK will provide. The store implementation should not be concerned with the format of this.

        The returned object's BigSegmentStoreTypes.Membership.checkMembership(String) method will return true for any segmentRef that is in the included list, false for any segmentRef that is in the excluded list and not also in the included list (that is, inclusions override exclusions), and null for all others.

        This method is optimized to return a singleton empty membership object whenever the inclusion and exclusions lists are both empty.

        The returned object implements Object.equals(Object) in such a way that it correctly tests equality when compared to any object returned from this factory method, but it is always unequal to any other types of objects.

        includedSegmentRefs - the inclusion list (null is equivalent to an empty iterable)
        excludedSegmentRefs - the exclusion list (null is equivalent to an empty iterable)
        an BigSegmentStoreTypes.Membership