public class QueryProfileType
extends com.yahoo.component.provider.FreezableSimpleComponent
Modifier and Type | Field and Description |
---|---|
private Map<String,String> |
aliases
Aliases *from* any strings *to* field names.
|
private boolean |
builtin |
private Map<String,FieldDescription> |
fields
The fields of this query profile type
|
private List<QueryProfileType> |
inherited
The query profile types this inherits
|
private boolean |
matchAsPath
True if the name of instances of this profile should be matched as path names, see QueryProfileRegistry
|
private boolean |
strict
If this is true, keys which are not declared in this type cannot be set in instances
|
Modifier | Constructor and Description |
---|---|
|
QueryProfileType(com.yahoo.component.ComponentId id) |
private |
QueryProfileType(com.yahoo.component.ComponentId id,
Map<String,FieldDescription> fields,
List<QueryProfileType> inherited,
boolean strict,
boolean matchAsPath,
boolean builtin,
Map<String,String> aliases) |
|
QueryProfileType(String idString) |
Modifier and Type | Method and Description |
---|---|
private void |
addAlias(String alias,
String field) |
void |
addField(FieldDescription fieldDescription)
Adds a field to this, without associating with a type registry; field descriptions with compound
is not be supported.
|
void |
addField(FieldDescription fieldDescription,
QueryProfileTypeRegistry registry)
Adds a field to this
|
Map<String,String> |
aliases()
Returns the alias to field mapping of this type as a read-only map.
|
Map<String,FieldDescription> |
declaredFields()
Returns the fields declared in this (i.e not including those inherited) as an immutable map.
|
boolean |
equals(Object o)
Two types are equal if they have the same id
|
Map<String,FieldDescription> |
fields()
Returns all the fields of this profile type and all types it inherits as a read-only map
|
void |
freeze() |
boolean |
getDeclaredMatchAsPath()
Returns true if this is declared as match as path.
|
FieldDescription |
getField(String name)
Returns the description of the field with the given name in this type or an inherited type
(depth first left to right search).
|
boolean |
getMatchAsPath()
Returns whether instances of this should be matched as path names.
|
private QueryProfileType |
getOrCreateQueryProfileType(String name,
QueryProfileTypeRegistry registry) |
QueryProfileType |
getType(String localName)
Returns the type of the given query profile type declared as a field in this
|
Class<?> |
getValueClass(String name)
Returns the permissible class for the value of the given name in this type
|
int |
hashCode() |
List<QueryProfileType> |
inherited()
Returns the query profile types inherited from this (never null).
|
boolean |
isBuiltin()
Returns whether this type is built into the system
|
boolean |
isDeclaredStrict()
Returns true if this is declared strict.
|
boolean |
isOverridable(String fieldName)
Returns whether the given field name is overridable in this type.
|
boolean |
isStrict()
Returns whether field not declared in this type is permissible in instances.
|
FieldDescription |
removeField(String fieldName)
Removes a field from this (not from any inherited profile)
|
void |
setBuiltin(boolean builtin)
Mark this type as built into the system.
|
void |
setMatchAsPath(boolean matchAsPath)
Returns whether instances of this should be matched as path names.
|
void |
setStrict(boolean strict)
Set whether nondeclared fields are permissible.
|
String |
toString() |
String |
unalias(String aliasOrField)
Returns the field name of an alias or field name
|
QueryProfileType |
unfrozen()
Return this is it is not frozen, returns a modifiable deeply unfrozen copy otherwise
|
clone, ensureNotFrozen, isFrozen
private Map<String,FieldDescription> fields
private List<QueryProfileType> inherited
private boolean strict
private boolean matchAsPath
private boolean builtin
public QueryProfileType(String idString)
public QueryProfileType(com.yahoo.component.ComponentId id)
private QueryProfileType(com.yahoo.component.ComponentId id, Map<String,FieldDescription> fields, List<QueryProfileType> inherited, boolean strict, boolean matchAsPath, boolean builtin, Map<String,String> aliases)
public QueryProfileType unfrozen()
public void setBuiltin(boolean builtin)
public boolean isBuiltin()
public List<QueryProfileType> inherited()
public Map<String,FieldDescription> declaredFields()
IllegalStateException
- if this is frozenpublic boolean isDeclaredStrict()
IllegalStateException
- if this is frozenpublic boolean getDeclaredMatchAsPath()
IllegalStateException
- if this is frozenpublic void setStrict(boolean strict)
public boolean isStrict()
public void setMatchAsPath(boolean matchAsPath)
public boolean getMatchAsPath()
public void freeze()
freeze
in interface com.yahoo.component.provider.Freezable
freeze
in class com.yahoo.component.provider.FreezableSimpleComponent
public boolean isOverridable(String fieldName)
public Class<?> getValueClass(String name)
Object
if all types are legal,
null if no types are legal (i.e if the name is not legal)public QueryProfileType getType(String localName)
public FieldDescription getField(String name)
public FieldDescription removeField(String fieldName)
IllegalStateException
- if this is frozenpublic void addField(FieldDescription fieldDescription)
IllegalStateException
- if this is frozenpublic void addField(FieldDescription fieldDescription, QueryProfileTypeRegistry registry)
IllegalStateException
- if this is frozenprivate QueryProfileType getOrCreateQueryProfileType(String name, QueryProfileTypeRegistry registry)
public Map<String,FieldDescription> fields()
public Map<String,String> aliases()
public boolean equals(Object o)
public String toString()
toString
in class com.yahoo.component.AbstractComponent
Copyright © 2018. All rights reserved.