Class RankingFilter

    • Constructor Detail

      • RankingFilter

        public RankingFilter​(java.util.List<Qualifier> measures,
                             java.util.List<Qualifier> attributes,
                             java.lang.String operator,
                             java.lang.Integer value)
        Creates a new RankingFilter instance.
        Parameters:
        measures - measures on which is the ranking applied. Must not be null.
        attributes - attributes that define ranking granularity. Optional, can be null.
        operator - operator that defines the type of ranking.
        value - number of requested ranked records.
        Throws:
        java.lang.NullPointerException - thrown when required parameter is not provided.
    • Method Detail

      • getObjQualifiers

        public java.util.Collection<ObjQualifier> getObjQualifiers()
        Returns all the qualifiers used by the ranking filter.

        This information comes handy if it is necessary, for example, to convert the ranking filter to use just the URI object qualifiers instead of the identifier object qualifiers. It can be used to gather these for a conversion service.

        Returns:
        all the qualifiers the ranking filter uses
      • withObjUriQualifiers

        public RankingFilter withObjUriQualifiers​(ObjQualifierConverter objQualifierConverter)
        Copy itself using the given object qualifier converter in case when IdentifierObjQualifier instances are used in the object otherwise the original object is returned.

        The provided converter must be able to handle the conversion for the qualifiers that are of the IdentifierObjQualifier type that are used by this object or its encapsulated child objects.

        Parameters:
        objQualifierConverter - The function that converts identifier qualifiers to the matching URI qualifiers. In case when the object uses the identifier qualifiers, it will return a new copy of itself or its encapsulated objects that used URI qualifiers, otherwise the original object is returned. The parameter must not be null.
        Returns:
        copy of itself with replaced qualifiers in case when some IdentifierObjQualifier were used, otherwise original object is returned.
        Throws:
        java.lang.IllegalArgumentException - The exception is thrown when conversion for the identifier qualifier used by this ranking filter could not be made by the provided converter or when provided converter is null.
      • getMeasures

        public java.util.List<Qualifier> getMeasures()
        Returns:
        measures on which is the ranking applied
      • getAttributes

        public java.util.List<Qualifier> getAttributes()
        Returns:
        granularity of the ranking
      • getOperator

        public RankingFilterOperator getOperator()
        Get operator as an enum constant for easier programmatic access.
        Returns:
        ranking operator constant
      • getOperatorAsString

        public java.lang.String getOperatorAsString()
        Get operator as a string representation of the RankingFilterOperator enum constant as it was parsed from the JSON.
        Returns:
        string operator provided at the time of the filter instance creation
      • getValue

        public java.lang.Integer getValue()
        Returns:
        number of ranked records
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object