public abstract class StringWithMacros extends Object implements TargetTranslatable<StringWithMacros>, StringMatcher
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
format(java.util.function.Function<? super MacroContainer,? extends CharSequence> mapper) |
com.google.common.collect.ImmutableList<MacroContainer> |
getMacros() |
abstract com.google.common.collect.ImmutableList<Either<String,MacroContainer>> |
getParts()
The components of the macro string.
|
int |
hashCode() |
<T> com.google.common.collect.ImmutableList<T> |
map(java.util.function.Function<? super String,? extends T> stringMapper,
java.util.function.Function<? super MacroContainer,? extends T> macroMapper) |
StringWithMacros |
mapStrings(java.util.function.Function<String,String> mapper) |
boolean |
matches(String s) |
static StringWithMacros |
of(com.google.common.collect.ImmutableList<Either<String,MacroContainer>> parts)
String with macros is a sequence of strings and macros.
|
static StringWithMacros |
ofConstantString(String singlePart)
Create a string with macros with a single string without macros
|
Optional<StringWithMacros> |
translateTargets(CellNameResolver cellPathResolver,
BaseName targetBaseName,
TargetNodeTranslator translator) |
public abstract com.google.common.collect.ImmutableList<Either<String,MacroContainer>> getParts()
public static StringWithMacros of(com.google.common.collect.ImmutableList<Either<String,MacroContainer>> parts)
public static StringWithMacros ofConstantString(String singlePart)
public com.google.common.collect.ImmutableList<MacroContainer> getMacros()
Macro
s in the macro string.public <T> com.google.common.collect.ImmutableList<T> map(java.util.function.Function<? super String,? extends T> stringMapper, java.util.function.Function<? super MacroContainer,? extends T> macroMapper)
public String format(java.util.function.Function<? super MacroContainer,? extends CharSequence> mapper)
public StringWithMacros mapStrings(java.util.function.Function<String,String> mapper)
StringWithMacros
with the string components transformed by mapper
.public Optional<StringWithMacros> translateTargets(CellNameResolver cellPathResolver, BaseName targetBaseName, TargetNodeTranslator translator)
translateTargets
in interface TargetTranslatable<StringWithMacros>
public boolean matches(String s)
matches
in interface StringMatcher