Class RankingFilter
java.lang.Object
com.gooddata.sdk.model.executeafm.afm.filter.RankingFilter
- All Implemented Interfaces:
CompatibilityFilter,ExtendedFilter,java.io.Serializable
public class RankingFilter extends java.lang.Object implements ExtendedFilter, CompatibilityFilter, java.io.Serializable
Represents a ranking filter applied on an insight.
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNAME -
Constructor Summary
Constructors Constructor Description RankingFilter(java.util.List<Qualifier> measures, java.util.List<Qualifier> attributes, RankingFilterOperator operator, java.lang.Integer value)RankingFilter(java.util.List<Qualifier> measures, java.util.List<Qualifier> attributes, java.lang.String operator, java.lang.Integer value)Creates a newRankingFilterinstance. -
Method Summary
Modifier and Type Method Description booleanequals(java.lang.Object o)java.util.List<Qualifier>getAttributes()java.util.List<Qualifier>getMeasures()java.util.Collection<ObjQualifier>getObjQualifiers()Returns all the qualifiers used by the ranking filter.RankingFilterOperatorgetOperator()Get operator as an enum constant for easier programmatic access.java.lang.StringgetOperatorAsString()Get operator as a string representation of theRankingFilterOperatorenum constant as it was parsed from the JSON.java.lang.IntegergetValue()inthashCode()java.lang.StringtoString()RankingFilterwithObjUriQualifiers(ObjQualifierConverter objQualifierConverter)Copy itself using the given object qualifier converter in case whenIdentifierObjQualifierinstances are used in the object otherwise the original object is returned.
-
Field Details
-
NAME
public static final java.lang.String NAME- See Also:
- Constant Field Values
-
-
Constructor Details
-
RankingFilter
public RankingFilter(java.util.List<Qualifier> measures, java.util.List<Qualifier> attributes, java.lang.String operator, java.lang.Integer value)Creates a newRankingFilterinstance.- 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.
-
RankingFilter
public RankingFilter(java.util.List<Qualifier> measures, java.util.List<Qualifier> attributes, RankingFilterOperator operator, java.lang.Integer value)
-
-
Method Details
-
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
Copy itself using the given object qualifier converter in case whenIdentifierObjQualifierinstances 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
IdentifierObjQualifiertype 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
IdentifierObjQualifierwere 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
- Returns:
- measures on which is the ranking applied
-
getAttributes
- Returns:
- granularity of the ranking
-
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 theRankingFilterOperatorenum 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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-