Package com.yahoo.search.query.profile
Class SubstituteString
- java.lang.Object
-
- com.yahoo.search.query.profile.SubstituteString
-
public class SubstituteString extends java.lang.Object
A string which contains one or more elements of the form %{name}, where these occurrences are to be replaced by a query profile lookup on name.This objects does the analysis on creation and provides a (reasonably) fast method of performing the actual substitution (at lookup time).
This is a value object. Lookups in this are thread safe.
- Author:
- bratseth
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SubstituteString
create(java.lang.String value)
Returns a new SubstituteString if the given string contains substitutions, null otherwise.boolean
equals(java.lang.Object other)
int
hashCode()
java.lang.String
substitute(java.util.Map<java.lang.String,java.lang.String> context, com.yahoo.processing.request.Properties substitution)
Perform the substitution in this, by looking up in the given query profile, and returns the resulting stringjava.lang.String
toString()
Returns this string in original (unsubstituted) form
-
-
-
Method Detail
-
create
public static SubstituteString create(java.lang.String value)
Returns a new SubstituteString if the given string contains substitutions, null otherwise.
-
substitute
public java.lang.String substitute(java.util.Map<java.lang.String,java.lang.String> context, com.yahoo.processing.request.Properties substitution)
Perform the substitution in this, by looking up in the given query profile, and returns the resulting string
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
Returns this string in original (unsubstituted) form- Overrides:
toString
in classjava.lang.Object
-
-