Package com.yahoo.search.query.profile
Class DimensionBinding
java.lang.Object
com.yahoo.search.query.profile.DimensionBinding
An immutable, binding of a list of dimensions to dimension values
- Author:
- bratseth
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptioncombineWith
(DimensionBinding other) Combines this binding with another if compatible.Returns a binding for a (possibly) new set of variants.static DimensionBinding
createFrom
(List<String> dimensions, DimensionValues dimensionValues) Creates a binding from a variant and a context.static DimensionBinding
Creates a binding from a variant and a context.static DimensionBinding
createFrom
(Map<String, String> values) boolean
Two bindings are equal if they contain the same dimensions and the same non-null valuesReturns a context created from the dimensions and values of thisReturns a read-only list of the dimensions of this.Returns the values for the dimensions of this.int
hashCode()
boolean
Returns true if this == invalidBindingboolean
isNull()
Returns true only if this binding is null (contains no values for its dimensions (if any)toString()
-
Field Details
-
nullBinding
-
invalidBinding
-
-
Method Details
-
createFrom
-
createFrom
Creates a binding from a variant and a context. Any of the arguments may be null. -
createFrom
Creates a binding from a variant and a context. Any of the arguments may be null. -
createFor
Returns a binding for a (possibly) new set of variants. Variants may be null, but not bindings -
getDimensions
Returns a read-only list of the dimensions of this. This value is undefined if this isNull() -
getContext
Returns a context created from the dimensions and values of this -
getValues
Returns the values for the dimensions of this. This value is undefined if this isEmpty() This array is always of the same length as the length of the dimension list - missing elements are represented as nulls. This is never null but may be empty. -
isNull
public boolean isNull()Returns true only if this binding is null (contains no values for its dimensions (if any) -
combineWith
Combines this binding with another if compatible. Two bindings are incompatible if- They contain a different value for the same key, or
- They contain the same pair of dimensions in a different order
- Returns:
- the combined binding, or the special invalidBinding if these two bindings are incompatible
-
isInvalid
public boolean isInvalid()Returns true if this == invalidBinding -
toString
-
equals
Two bindings are equal if they contain the same dimensions and the same non-null values -
hashCode
public int hashCode()
-