Package org.spongepowered.api.state
Interface StateMatcher<S extends State<S>>
- 
- All Superinterfaces:
- java.util.function.Predicate<S>
 
 public interface StateMatcher<S extends State<S>> extends java.util.function.Predicate<S>AStateMatcherthat will match variousStates according to a pre-built list ofStatePropertys and their values, such that not allStatePropertys contained in aStatemust be matched.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static interfaceStateMatcher.Builder<S extends State<S>,T extends StateContainer<S>>A builder forStateMatchers.static interfaceStateMatcher.FactoryFactories for generating builders.
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static StateMatcher.Builder<BlockState,BlockType>blockStateMatcherBuilder()Creates a newStateMatcher.Builderfor matchingBlockStates.java.util.List<S>compatibleStates()Gets aListof compatibleStates.static StateMatcher.Builder<FluidState,FluidType>fluidStateMatcherBuilder()Creates a newStateMatcher.Builderfor matchingFluidStates.booleanmatches(S state)Gets atruereturn value if the providedStatesufficiently matches the pre-definedStatePropertyvalues andKeyValueMatchers.default booleantest(S state)
 
- 
- 
- 
Method Detail- 
blockStateMatcherBuilderstatic StateMatcher.Builder<BlockState,BlockType> blockStateMatcherBuilder() Creates a newStateMatcher.Builderfor matchingBlockStates.- Returns:
- The builder
 
 - 
fluidStateMatcherBuilderstatic StateMatcher.Builder<FluidState,FluidType> fluidStateMatcherBuilder() Creates a newStateMatcher.Builderfor matchingFluidStates.- Returns:
- The builder
 
 - 
matchesboolean matches(S state) Gets atruereturn value if the providedStatesufficiently matches the pre-definedStatePropertyvalues andKeyValueMatchers.- Parameters:
- state- The state in question
- Returns:
- True if the state sufficiently matches
 
 - 
compatibleStatesjava.util.List<S> compatibleStates() Gets aListof compatibleStates.- Returns:
- The list of compatible states
 
 
- 
 
-