Package com.yahoo.search.query.profile
Class BackedOverridableQueryProfile
java.lang.Object
com.yahoo.component.AbstractComponent
com.yahoo.component.provider.FreezableSimpleComponent
com.yahoo.search.query.profile.QueryProfile
com.yahoo.search.query.profile.OverridableQueryProfile
com.yahoo.search.query.profile.BackedOverridableQueryProfile
- All Implemented Interfaces:
com.yahoo.component.Component,com.yahoo.component.Deconstructable,com.yahoo.component.provider.Freezable,Cloneable,Comparable<com.yahoo.component.Component>
A wrapper of a query profile where overrides to the values in the referenced
profile can be set.
This is used to allow configured overrides (in a particular referencing profile) of a referenced query profile.
Properties which are defined as not overridable in the type (if any) of the referenced query profile
cannot be set.
- Author:
- bratseth
-
Field Summary
Fields inherited from class com.yahoo.search.query.profile.QueryProfile
ownerFields inherited from class com.yahoo.component.AbstractComponent
isDeconstructable -
Constructor Summary
ConstructorsConstructorDescriptionBackedOverridableQueryProfile(QueryProfile backingProfile) Creates an overridable profile from the given backing profile. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInherited(QueryProfile inherited) Adds a profile to the end of the inherited list of this.clone()Returns a clone of this which can be independently overridden, but which refers to the same backing profileprotected QueryProfilecreateSubProfile(String name, DimensionBinding dimensionBinding) Looks up all inherited profiles and adds any that matches this name.voidfreeze()Switches this from write-only to read-only mode.Returns the query profile backing thisReturns all the content from this: All the values in this, and all values in the backing where an overriding value is not set in thisprotected ObjectgetContent(String localKey) Returns a value from the content of this: The value in this, or the value from the backing if not set in thisReturns the variant dimensions to be used in this - an unmodifiable list of dimension namesbooleanprotected BooleanisLocalInstanceOverridable(String localName) protected ObjectlocalLookup(String localName, DimensionBinding dimensionBinding) Do a variant-aware content lookup in thistoString()protected voidvisitInherited(boolean allowContent, com.yahoo.search.query.profile.QueryProfileVisitor visitor, DimensionBinding dimensionBinding, QueryProfile owner) protected voidvisitVariants(boolean allowContent, com.yahoo.search.query.profile.QueryProfileVisitor visitor, DimensionBinding dimensionBinding) Methods inherited from class com.yahoo.search.query.profile.OverridableQueryProfile
checkAndConvertAssignmentMethods inherited from class com.yahoo.search.query.profile.QueryProfile
accept, addInherited, addInherited, compile, declaredContent, get, get, get, get, get, get, get, getOwner, getType, getValue, getVariants, inherited, isDeclaredOverridable, listValues, listValues, listValues, listValues, listValues, lookup, lookup, set, set, set, set, set, set, setDimensions, setLocalNode, setOverridable, setOverridable, setType, setValue, validateNameMethods inherited from class com.yahoo.component.provider.FreezableSimpleComponent
ensureNotFrozen, isFrozenMethods inherited from class com.yahoo.component.AbstractComponent
compareTo, deconstruct, getClassName, getId, getIdString, hasInitializedId, initId, isDeconstructable, setIsDeconstructable
-
Constructor Details
-
BackedOverridableQueryProfile
Creates an overridable profile from the given backing profile. The backing profile will never be written to.- Parameters:
backingProfile- the backing profile, which is assumed read only, never null
-
-
Method Details
-
getSource
- Overrides:
getSourcein classQueryProfile
-
freeze
public void freeze()Description copied from class:QueryProfileSwitches this from write-only to read-only mode. This profile can never be modified again after this method returns. Calling this on an already frozen profile has no effect. Calling this will also freeze any profiles inherited and referenced by this.- Specified by:
freezein interfacecom.yahoo.component.provider.Freezable- Overrides:
freezein classQueryProfile
-
localLookup
Description copied from class:QueryProfileDo a variant-aware content lookup in this- Overrides:
localLookupin classQueryProfile
-
isLocalInstanceOverridable
- Overrides:
isLocalInstanceOverridablein classQueryProfile
-
createSubProfile
Description copied from class:QueryProfileLooks up all inherited profiles and adds any that matches this name. This default implementation returns an empty profile.- Overrides:
createSubProfilein classOverridableQueryProfile
-
clone
Returns a clone of this which can be independently overridden, but which refers to the same backing profile- Overrides:
clonein classOverridableQueryProfile
-
getBacking
Returns the query profile backing this -
addInherited
Description copied from class:QueryProfileAdds a profile to the end of the inherited list of this. Throws an exception if this is frozen.- Overrides:
addInheritedin classQueryProfile
-
visitVariants
protected void visitVariants(boolean allowContent, com.yahoo.search.query.profile.QueryProfileVisitor visitor, DimensionBinding dimensionBinding) - Overrides:
visitVariantsin classQueryProfile
-
visitInherited
protected void visitInherited(boolean allowContent, com.yahoo.search.query.profile.QueryProfileVisitor visitor, DimensionBinding dimensionBinding, QueryProfile owner) - Overrides:
visitInheritedin classQueryProfile
-
getContent
Returns a value from the content of this: The value in this, or the value from the backing if not set in this- Overrides:
getContentin classQueryProfile
-
getContent
Returns all the content from this: All the values in this, and all values in the backing where an overriding value is not set in this- Overrides:
getContentin classQueryProfile
-
toString
- Overrides:
toStringin classOverridableQueryProfile
-
isExplicit
public boolean isExplicit()- Overrides:
isExplicitin classQueryProfile
-
getDimensions
Description copied from class:QueryProfileReturns the variant dimensions to be used in this - an unmodifiable list of dimension names- Overrides:
getDimensionsin classQueryProfile
-