public final class ConditionalsConfig extends Object
Conditionals
plugin and individual ConditionalAtRuleBlock
objects, and other options.
This can be used to add to or remove from the set of "trueConditions". You can also specify "passthroughMode" as true, which
indicates that the ConditionalAtRuleBlock
should write itself out without stripping the actual outer block
(@if(...) { ... }
) away. This might be useful if you intend to deal with the conditionals as part of a subsequent
parsing operation.
Constructor and Description |
---|
ConditionalsConfig() |
Modifier and Type | Method and Description |
---|---|
ConditionalsConfig |
addTrueConditions(Iterable<String> trueConditions)
Adds the given strings to the trueConditions set.
|
ConditionalsConfig |
addTrueConditions(String... trueConditions)
Adds the given strings to the trueConditions set.
|
ConditionalsConfig |
clearTrueConditions()
Removes all current trueConditions.
|
boolean |
hasCondition(String condition)
Gets whether the given condition is "true".
|
boolean |
isPassthroughMode()
Gets whether passthroughMode is true or false.
|
ConditionalsConfig |
passthroughMode(boolean passthroughMode)
Sets the passthroughMode status.
|
ConditionalsConfig |
removeTrueCondition(String condition)
Removes the given condition from the trueConditions set.
|
ConditionalsConfig |
replaceTrueConditions(Iterable<String> trueConditions)
Removes the currently set true conditions and adds the given true conditions.
|
ConditionalsConfig |
replaceTrueConditions(String... trueConditions)
Removes the currently set true conditions and adds the given true conditions.
|
String |
toString() |
com.google.common.collect.ImmutableSet<String> |
trueConditions()
Returns an immutable copy of the trueConditions set.
|
public boolean hasCondition(String condition)
condition
- Check if this condition is contained within the "trueConditions" set. This should be lower-cased!public com.google.common.collect.ImmutableSet<String> trueConditions()
public ConditionalsConfig addTrueConditions(String... trueConditions)
trueConditions
- The strings that should evaluate to "true".public ConditionalsConfig addTrueConditions(Iterable<String> trueConditions)
trueConditions
- Iterable of the strings that should evaluate to "true".public ConditionalsConfig removeTrueCondition(String condition)
condition
- The condition to remove.public ConditionalsConfig clearTrueConditions()
public ConditionalsConfig replaceTrueConditions(String... trueConditions)
trueConditions
- Replace all current true conditions with these.public ConditionalsConfig replaceTrueConditions(Iterable<String> trueConditions)
trueConditions
- Replace all current true conditions with these.public ConditionalsConfig passthroughMode(boolean passthroughMode)
passthroughMode
- Whether passthroughMode is true or false.public boolean isPassthroughMode()
Copyright (c) 2019, Salesforce.com, Inc. All rights reserved. Licensed under the BSD 3-Clause license. For full license text, see the LICENSE file in the repository.