Class RetrievalFilter

    • Method Detail

      • hasAndAll

        public final boolean hasAndAll()
        For responses, this returns true if the service returned a value for the AndAll property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
      • andAll

        public final List<RetrievalFilter> andAll()

        Knowledge base data sources whose metadata attributes fulfill all the filter conditions inside this list are returned.

        Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

        This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasAndAll() method.

        Returns:
        Knowledge base data sources whose metadata attributes fulfill all the filter conditions inside this list are returned.
      • equalsValue

        public final FilterAttribute equalsValue()

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value matches the value in this object are returned.

        Returns:
        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value matches the value in this object are returned.
      • greaterThan

        public final FilterAttribute greaterThan()

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is greater than the value in this object are returned.

        Returns:
        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is greater than the value in this object are returned.
      • greaterThanOrEquals

        public final FilterAttribute greaterThanOrEquals()

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is greater than or equal to the value in this object are returned.

        Returns:
        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is greater than or equal to the value in this object are returned.
      • in

        public final FilterAttribute in()

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is in the list specified in the value in this object are returned.

        Returns:
        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is in the list specified in the value in this object are returned.
      • lessThan

        public final FilterAttribute lessThan()

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is less than the value in this object are returned.

        Returns:
        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is less than the value in this object are returned.
      • lessThanOrEquals

        public final FilterAttribute lessThanOrEquals()

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is less than or equal to the value in this object are returned.

        Returns:
        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is less than or equal to the value in this object are returned.
      • notEquals

        public final FilterAttribute notEquals()

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value doesn't match the value in this object are returned.

        Returns:
        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value doesn't match the value in this object are returned.
      • notIn

        public final FilterAttribute notIn()

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value isn't in the list specified in the value in this object are returned.

        Returns:
        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value isn't in the list specified in the value in this object are returned.
      • hasOrAll

        public final boolean hasOrAll()
        For responses, this returns true if the service returned a value for the OrAll property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
      • orAll

        public final List<RetrievalFilter> orAll()

        Knowledge base data sources whose metadata attributes fulfill at least one of the filter conditions inside this list are returned.

        Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

        This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasOrAll() method.

        Returns:
        Knowledge base data sources whose metadata attributes fulfill at least one of the filter conditions inside this list are returned.
      • startsWith

        public final FilterAttribute startsWith()

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value starts with the value in this object are returned. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.

        Returns:
        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value starts with the value in this object are returned. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • toString

        public final String toString()
        Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
        Overrides:
        toString in class Object
      • getValueForField

        public final <T> Optional<T> getValueForField​(String fieldName,
                                                      Class<T> clazz)
      • fromAndAll

        public static RetrievalFilter fromAndAll​(List<RetrievalFilter> andAll)
        Create an instance of this class with andAll() initialized to the given value.

        Knowledge base data sources whose metadata attributes fulfill all the filter conditions inside this list are returned.

        Parameters:
        andAll - Knowledge base data sources whose metadata attributes fulfill all the filter conditions inside this list are returned.
      • fromEqualsValue

        public static RetrievalFilter fromEqualsValue​(FilterAttribute equalsValue)
        Create an instance of this class with equalsValue() initialized to the given value.

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value matches the value in this object are returned.

        Parameters:
        equalsValue - Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value matches the value in this object are returned.
      • fromEqualsValue

        public static RetrievalFilter fromEqualsValue​(Consumer<FilterAttribute.Builder> equalsValue)
        Create an instance of this class with equalsValue() initialized to the given value.

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value matches the value in this object are returned.

        Parameters:
        equalsValue - Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value matches the value in this object are returned.
      • fromGreaterThan

        public static RetrievalFilter fromGreaterThan​(FilterAttribute greaterThan)
        Create an instance of this class with greaterThan() initialized to the given value.

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is greater than the value in this object are returned.

        Parameters:
        greaterThan - Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is greater than the value in this object are returned.
      • fromGreaterThan

        public static RetrievalFilter fromGreaterThan​(Consumer<FilterAttribute.Builder> greaterThan)
        Create an instance of this class with greaterThan() initialized to the given value.

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is greater than the value in this object are returned.

        Parameters:
        greaterThan - Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is greater than the value in this object are returned.
      • fromGreaterThanOrEquals

        public static RetrievalFilter fromGreaterThanOrEquals​(FilterAttribute greaterThanOrEquals)
        Create an instance of this class with greaterThanOrEquals() initialized to the given value.

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is greater than or equal to the value in this object are returned.

        Parameters:
        greaterThanOrEquals - Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is greater than or equal to the value in this object are returned.
      • fromGreaterThanOrEquals

        public static RetrievalFilter fromGreaterThanOrEquals​(Consumer<FilterAttribute.Builder> greaterThanOrEquals)
        Create an instance of this class with greaterThanOrEquals() initialized to the given value.

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is greater than or equal to the value in this object are returned.

        Parameters:
        greaterThanOrEquals - Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is greater than or equal to the value in this object are returned.
      • fromIn

        public static RetrievalFilter fromIn​(FilterAttribute in)
        Create an instance of this class with in() initialized to the given value.

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is in the list specified in the value in this object are returned.

        Parameters:
        in - Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is in the list specified in the value in this object are returned.
      • fromIn

        public static RetrievalFilter fromIn​(Consumer<FilterAttribute.Builder> in)
        Create an instance of this class with in() initialized to the given value.

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is in the list specified in the value in this object are returned.

        Parameters:
        in - Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is in the list specified in the value in this object are returned.
      • fromLessThan

        public static RetrievalFilter fromLessThan​(FilterAttribute lessThan)
        Create an instance of this class with lessThan() initialized to the given value.

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is less than the value in this object are returned.

        Parameters:
        lessThan - Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is less than the value in this object are returned.
      • fromLessThan

        public static RetrievalFilter fromLessThan​(Consumer<FilterAttribute.Builder> lessThan)
        Create an instance of this class with lessThan() initialized to the given value.

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is less than the value in this object are returned.

        Parameters:
        lessThan - Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is less than the value in this object are returned.
      • fromLessThanOrEquals

        public static RetrievalFilter fromLessThanOrEquals​(FilterAttribute lessThanOrEquals)
        Create an instance of this class with lessThanOrEquals() initialized to the given value.

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is less than or equal to the value in this object are returned.

        Parameters:
        lessThanOrEquals - Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is less than or equal to the value in this object are returned.
      • fromLessThanOrEquals

        public static RetrievalFilter fromLessThanOrEquals​(Consumer<FilterAttribute.Builder> lessThanOrEquals)
        Create an instance of this class with lessThanOrEquals() initialized to the given value.

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is less than or equal to the value in this object are returned.

        Parameters:
        lessThanOrEquals - Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is less than or equal to the value in this object are returned.
      • fromNotEquals

        public static RetrievalFilter fromNotEquals​(FilterAttribute notEquals)
        Create an instance of this class with notEquals() initialized to the given value.

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value doesn't match the value in this object are returned.

        Parameters:
        notEquals - Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value doesn't match the value in this object are returned.
      • fromNotEquals

        public static RetrievalFilter fromNotEquals​(Consumer<FilterAttribute.Builder> notEquals)
        Create an instance of this class with notEquals() initialized to the given value.

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value doesn't match the value in this object are returned.

        Parameters:
        notEquals - Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value doesn't match the value in this object are returned.
      • fromNotIn

        public static RetrievalFilter fromNotIn​(FilterAttribute notIn)
        Create an instance of this class with notIn() initialized to the given value.

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value isn't in the list specified in the value in this object are returned.

        Parameters:
        notIn - Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value isn't in the list specified in the value in this object are returned.
      • fromNotIn

        public static RetrievalFilter fromNotIn​(Consumer<FilterAttribute.Builder> notIn)
        Create an instance of this class with notIn() initialized to the given value.

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value isn't in the list specified in the value in this object are returned.

        Parameters:
        notIn - Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value isn't in the list specified in the value in this object are returned.
      • fromOrAll

        public static RetrievalFilter fromOrAll​(List<RetrievalFilter> orAll)
        Create an instance of this class with orAll() initialized to the given value.

        Knowledge base data sources whose metadata attributes fulfill at least one of the filter conditions inside this list are returned.

        Parameters:
        orAll - Knowledge base data sources whose metadata attributes fulfill at least one of the filter conditions inside this list are returned.
      • fromStartsWith

        public static RetrievalFilter fromStartsWith​(FilterAttribute startsWith)
        Create an instance of this class with startsWith() initialized to the given value.

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value starts with the value in this object are returned. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.

        Parameters:
        startsWith - Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value starts with the value in this object are returned. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.
      • fromStartsWith

        public static RetrievalFilter fromStartsWith​(Consumer<FilterAttribute.Builder> startsWith)
        Create an instance of this class with startsWith() initialized to the given value.

        Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value starts with the value in this object are returned. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.

        Parameters:
        startsWith - Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value starts with the value in this object are returned. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.