public class SubstituteString extends Object
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.
Modifier and Type | Class and Description |
---|---|
private static class |
SubstituteString.Component |
private static class |
SubstituteString.PropertyComponent |
private static class |
SubstituteString.StringComponent |
Modifier and Type | Field and Description |
---|---|
private List<SubstituteString.Component> |
components |
private String |
stringValue |
Modifier | Constructor and Description |
---|---|
private |
SubstituteString(List<SubstituteString.Component> components,
String stringValue) |
Modifier and Type | Method and Description |
---|---|
static SubstituteString |
create(String value)
Returns a new SubstituteString if the given string contains substitutions, null otherwise.
|
boolean |
equals(Object other) |
int |
hashCode() |
String |
substitute(Map<String,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
|
String |
toString()
Returns this string in original (unsubstituted) form
|
private final List<SubstituteString.Component> components
private final String stringValue
private SubstituteString(List<SubstituteString.Component> components, String stringValue)
public static SubstituteString create(String value)
public String substitute(Map<String,String> context, com.yahoo.processing.request.Properties substitution)
Copyright © 2018. All rights reserved.