Package org.openremote.manager.rules
Class AssetQueryPredicate
java.lang.Object
org.openremote.manager.rules.AssetQueryPredicate
- All Implemented Interfaces:
Predicate<org.openremote.model.attribute.AttributeInfo>
public class AssetQueryPredicate
extends Object
implements Predicate<org.openremote.model.attribute.AttributeInfo>
Test an
AttributeInfo with a AssetQuery.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AssetStorageServiceprotected final org.openremote.model.query.AssetQueryprotected final org.openremote.container.timer.TimerService -
Constructor Summary
ConstructorsConstructorDescriptionAssetQueryPredicate(org.openremote.container.timer.TimerService timerService, AssetStorageService assetStorageService, org.openremote.model.query.AssetQuery query) -
Method Summary
Modifier and TypeMethodDescriptionstatic Function<Collection<org.openremote.model.attribute.AttributeInfo>, Set<org.openremote.model.attribute.AttributeInfo>> asAttributeMatcher(Supplier<Long> currentMillisProducer, org.openremote.model.query.LogicGroup<org.openremote.model.query.filter.AttributePredicate> condition) A function for matchingAttributeInfos of an asset; the infos must be related to the same asset to allowLogicGroup.Operator.ANDto be applied.static Predicate<org.openremote.model.value.NameValueHolder<?>> asPredicate(Supplier<Long> currentMillisSupplier, org.openremote.model.query.filter.NameValuePredicate predicate) static Predicate<org.openremote.model.attribute.AttributeInfo> asPredicate(org.openremote.model.query.filter.ParentPredicate predicate) asPredicate(org.openremote.model.query.filter.PathPredicate predicate) static Predicate<org.openremote.model.attribute.AttributeInfo> asPredicate(org.openremote.model.query.filter.RealmPredicate predicate) protected static booleangroupIsEmpty(org.openremote.model.query.LogicGroup<?> condition) booleantest(org.openremote.model.attribute.AttributeInfo assetState)
-
Field Details
-
query
protected final org.openremote.model.query.AssetQuery query -
timerService
protected final org.openremote.container.timer.TimerService timerService -
assetStorageService
-
resolvedAssetTypes
-
-
Constructor Details
-
AssetQueryPredicate
public AssetQueryPredicate(org.openremote.container.timer.TimerService timerService, AssetStorageService assetStorageService, org.openremote.model.query.AssetQuery query)
-
-
Method Details
-
test
public boolean test(org.openremote.model.attribute.AttributeInfo assetState) -
asPredicate
public static Predicate<org.openremote.model.attribute.AttributeInfo> asPredicate(org.openremote.model.query.filter.ParentPredicate predicate) -
asPredicate
-
asPredicate
public static Predicate<org.openremote.model.attribute.AttributeInfo> asPredicate(org.openremote.model.query.filter.RealmPredicate predicate) -
asPredicate
-
asAttributeMatcher
public static Function<Collection<org.openremote.model.attribute.AttributeInfo>,Set<org.openremote.model.attribute.AttributeInfo>> asAttributeMatcher(Supplier<Long> currentMillisProducer, org.openremote.model.query.LogicGroup<org.openremote.model.query.filter.AttributePredicate> condition) A function for matchingAttributeInfos of an asset; the infos must be related to the same asset to allowLogicGroup.Operator.ANDto be applied.- Returns:
- The matched asset states or null if there is no match
-
groupIsEmpty
protected static boolean groupIsEmpty(org.openremote.model.query.LogicGroup<?> condition)
-