public class QueryProfileVariants extends Object implements com.yahoo.component.provider.Freezable, Cloneable
A set of virtual profiles are always owned by a single profile, which is also their parent in the inheritance hierarchy.
Modifier and Type | Class and Description |
---|---|
static class |
QueryProfileVariants.FieldValue |
static class |
QueryProfileVariants.FieldValues |
Constructor and Description |
---|
QueryProfileVariants(List<String> dimensions,
QueryProfile owner)
Creates a set of virtual query profiles which may return varying values over the set of dimensions given.
|
QueryProfileVariants(String[] dimensions,
QueryProfile owner)
Creates a set of virtual query profiles which may return varying values over the set of dimensions given.
|
Modifier and Type | Method and Description |
---|---|
QueryProfileVariants |
clone() |
protected void |
ensureNotFrozen()
Throws an IllegalStateException if this is frozen
|
void |
freeze()
Irreversibly prevents any further modifications to this
|
Object |
get(String name,
QueryProfileType type,
boolean allowQueryProfileResult,
DimensionBinding dimensionBinding)
Returns the most specific matching value of a name for a given set of canonical dimension values.
|
List<String> |
getDimensions()
Returns the dimensions over which the virtual profiles in this may return different values.
|
Map<String,QueryProfileVariants.FieldValues> |
getFieldValues()
Returns the map of field values of this indexed by field name.
|
QueryProfileVariants.FieldValues |
getInherited()
Returns the profiles inherited from various variants of this
|
QueryProfileVariant |
getVariant(DimensionValues dimensionValues,
boolean create)
Returns the query profile variant having exactly the given dimensions, and creates it if create is set and
it is missing
|
List<QueryProfileVariant> |
getVariants()
Returns all the variants of this, sorted by specificity.
|
void |
inherit(QueryProfile profile,
DimensionValues dimensionValues)
Inherits a particular profile in a variant of this
|
boolean |
isFrozen() |
void |
set(String fieldName,
DimensionValues dimensionValues,
Object value)
Sets a value to this
|
public QueryProfileVariants(String[] dimensions, QueryProfile owner)
public QueryProfileVariants(List<String> dimensions, QueryProfile owner)
dimensions
- the dimension names this may vary over. The list gets owned by this, so it must not be further
modified from outside). This will not modify the list.public void freeze()
freeze
in interface com.yahoo.component.provider.Freezable
public boolean isFrozen()
isFrozen
in interface com.yahoo.component.provider.Freezable
public Object get(String name, QueryProfileType type, boolean allowQueryProfileResult, DimensionBinding dimensionBinding)
name
- the name to return the best matching value ofdimensionBinding
- the dimension bindings to use in thispublic void inherit(QueryProfile profile, DimensionValues dimensionValues)
public void set(String fieldName, DimensionValues dimensionValues, Object value)
fieldName
- the name of the field to set. This cannot be a compound (dotted) namedimensionValues
- the dimension values for which this value appliesvalue
- the value to setpublic List<String> getDimensions()
public Map<String,QueryProfileVariants.FieldValues> getFieldValues()
public QueryProfileVariants.FieldValues getInherited()
public List<QueryProfileVariant> getVariants()
public QueryProfileVariants clone()
protected void ensureNotFrozen()
public QueryProfileVariant getVariant(DimensionValues dimensionValues, boolean create)
dimensionValues
- the dimension valuescreate
- whether or not to create the variant if missingCopyright © 2018. All rights reserved.