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

    Fields
    Modifier and Type
    Field
    Description
    protected final AssetStorageService
     
    protected final org.openremote.model.query.AssetQuery
     
    protected final List<String>
     
    protected final org.openremote.container.timer.TimerService
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    AssetQueryPredicate(org.openremote.container.timer.TimerService timerService, AssetStorageService assetStorageService, org.openremote.model.query.AssetQuery query)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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 matching AttributeInfos of an asset; the infos must be related to the same asset to allow LogicGroup.Operator.AND to 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)
     
    static Predicate<String[]>
    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 boolean
    groupIsEmpty(org.openremote.model.query.LogicGroup<?> condition)
     
    boolean
    test(org.openremote.model.attribute.AttributeInfo assetState)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.function.Predicate

    and, negate, or
  • Field Details

    • query

      protected final org.openremote.model.query.AssetQuery query
    • timerService

      protected final org.openremote.container.timer.TimerService timerService
    • assetStorageService

      protected final AssetStorageService assetStorageService
    • resolvedAssetTypes

      protected final List<String> 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)
      Specified by:
      test in interface Predicate<org.openremote.model.attribute.AttributeInfo>
    • asPredicate

      public static Predicate<org.openremote.model.attribute.AttributeInfo> asPredicate(org.openremote.model.query.filter.ParentPredicate predicate)
    • asPredicate

      public static Predicate<String[]> asPredicate(org.openremote.model.query.filter.PathPredicate predicate)
    • asPredicate

      public static Predicate<org.openremote.model.attribute.AttributeInfo> asPredicate(org.openremote.model.query.filter.RealmPredicate predicate)
    • asPredicate

      public static Predicate<org.openremote.model.value.NameValueHolder<?>> asPredicate(Supplier<Long> currentMillisSupplier, org.openremote.model.query.filter.NameValuePredicate predicate)
    • 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 matching AttributeInfos of an asset; the infos must be related to the same asset to allow LogicGroup.Operator.AND to 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)