Tabnine Logo
PredicateBuilder
Code IndexAdd Tabnine to your IDE (free)

How to use
PredicateBuilder
in
com.hazelcast.query

Best Java code snippets using com.hazelcast.query.PredicateBuilder (Showing top 20 results out of 315)

origin: apifest/apifest-oauth20

@Override
@SuppressWarnings("unchecked")
public AccessToken findAccessTokenByRefreshToken(String refreshToken, String clientId) {
  EntryObject eo = new PredicateBuilder().getEntryObject();
  Predicate<String, String> predicate = eo.get("refreshTokenByClient").equal(refreshToken + clientId);
  Collection<PersistentAccessToken> values = getAccessTokenContainer().values(predicate);
  if (values.isEmpty()) {
    return null;
  }
  return PersistenceTransformations.toAccessToken(values.iterator().next());
}
origin: hazelcast/hazelcast-code-samples

private Set<Person> getWithNameAndAgeSimplified(String name, int age) {
  EntryObject e = new PredicateBuilder().getEntryObject();
  Predicate predicate = e.get("name").equal(name).and(e.get("age").equal(age));
  return (Set<Person>) personMap.values(predicate);
}
origin: hazelcast/hazelcast-jet

public EntryObject get(String attribute) {
  if (KEY_ATTRIBUTE_NAME.value().equals(qb.getAttribute())) {
    qb.setAttribute(KEY_ATTRIBUTE_NAME.value() + "#" + attribute);
  } else {
    qb.setAttribute(attribute);
  }
  return this;
}
origin: hazelcast/hazelcast-jet

public PredicateBuilder equal(Comparable value) {
  return addPredicate(Predicates.equal(qb.getAttribute(), value));
}
origin: stackoverflow.com

 EntryObject eo = new PredicateBuilder().getEntryObject();
Predicate fredWithStartTimeThisYear = eo.key().get("Description").equal("Fred")
 .and(eo.key().get("theStartTime.Year").equal(2015));
origin: hazelcast/hazelcast-jet

public EntryObject key() {
  qb.setAttribute(KEY_ATTRIBUTE_NAME.value());
  return this;
}
origin: hazelcast/hazelcast-jet

public PredicateBuilder greaterThan(Comparable value) {
  return addPredicate(Predicates.greaterThan(qb.getAttribute(), value));
}
origin: stackoverflow.com

EntryObject entryObject = new PredicateBuilder().getEntryObject();
PredicateBuilder builder = entryObject.key().get("date").isNull();
origin: com.hazelcast/hazelcast-all

public EntryObject key() {
  qb.setAttribute(KEY_ATTRIBUTE_NAME.value());
  return this;
}
origin: apifest/apifest-oauth20

@Override
@SuppressWarnings("unchecked")
public AuthCode findAuthCode(String authCode, String redirectUri) {
  EntryObject eo = new PredicateBuilder().getEntryObject();
  Predicate<String, String> predicate = eo.get("codeURI").equal(authCode + redirectUri + true);
  Collection<PersistentAuthCode> values = getAuthCodeContainer().values(predicate);
  if (values.isEmpty()) {
    return null;
  }
  return PersistenceTransformations.toAuthCode(values.iterator().next());
}
origin: com.hazelcast.simulator/tests-common

@TimeStep(prob = 0.2)
public void predicateBuilder(ThreadState state) {
  long startMs = System.currentTimeMillis();
  int age = state.randomInt(Employee.MAX_AGE);
  String name = Employee.getRandomName();
  // TODO: Still broken because it relies on reflection which is dog slow, so we need an explicit AgeNamePredicate
  EntryObject entryObject = new PredicateBuilder().getEntryObject();
  Predicate agePredicate = entryObject.get("age").lessThan(age);
  Predicate ageNamePredicate = entryObject.get("name").equal(name).and(agePredicate);
  Collection<Employee> employees = map.values(ageNamePredicate);
  for (Employee emp : employees) {
    String assertMessage = format(baseAssertMessage, emp, ageNamePredicate);
    assertTrue(assertMessage, emp.getAge() < age);
    assertTrue(assertMessage, emp.getName().equals(name));
  }
  state.operationCounter.predicateBuilderCount++;
  updateStats(state, startMs);
}
origin: hazelcast/hazelcast-jet

public PredicateBuilder between(Comparable from, Comparable to) {
  return addPredicate(Predicates.between(qb.getAttribute(), from, to));
}
origin: com.hazelcast/hazelcast-all

public EntryObject get(String attribute) {
  if (KEY_ATTRIBUTE_NAME.value().equals(qb.getAttribute())) {
    qb.setAttribute(KEY_ATTRIBUTE_NAME.value() + "#" + attribute);
  } else {
    qb.setAttribute(attribute);
  }
  return this;
}
origin: GeoWebCache/geowebcache

@Override
public void removeLayer(String layername) {
  if (configured) {
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("Removing Layer:" + layername);
    }
    // Creation of the Predicate
    EntryObject e = new PredicateBuilder().getEntryObject();
    Predicate predicate = e.get("layer_name").equal(layername);
    // Creation of the processor
    CacheEntryProcessor entryProcessor = new CacheEntryProcessor();
    // Execution of the Processor
    map.executeOnEntries(entryProcessor, predicate);
  } else {
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("Cache not configured");
    }
  }
}
origin: com.hazelcast.stabilizer/stabilizer

final String name = Employee.names[random.nextInt(Employee.names.length)];
EntryObject entryObject = new PredicateBuilder().getEntryObject();
Predicate agePredicate = entryObject.get( "age" ).lessThan(age);
Predicate predicate = entryObject.get( "name" ).equal( name ).and( agePredicate );
Collection<Employee> employees = map.values(predicate);
origin: hazelcast/hazelcast-jet

public PredicateBuilder notEqual(Comparable value) {
  return addPredicate(Predicates.notEqual(qb.getAttribute(), value));
}
origin: apifest/apifest-oauth20

@Override
@SuppressWarnings("unchecked")
public List<AccessToken> getAccessTokenByUserIdAndClientApp(String userId, String clientId) {
  List<AccessToken> accessTokens = new ArrayList<AccessToken>();
  EntryObject eo = new PredicateBuilder().getEntryObject();
  Predicate<String, String> predicate = eo.get("accessTokenByUserIdAndClient").equal(userId + clientId + true);
  Collection<PersistentAccessToken> values = getAccessTokenContainer().values(predicate);
  if (!values.isEmpty()) {
    for (PersistentAccessToken token : values) {
      accessTokens.add(PersistenceTransformations.toAccessToken(token));
    }
  }
  return accessTokens;
}
origin: hazelcast/hazelcast-jet

public PredicateBuilder in(Comparable... values) {
  return addPredicate(Predicates.in(qb.getAttribute(), values));
}
origin: org.geowebcache/gwc-distributed

@Override
public void removeLayer(String layername) {
  if (configured) {
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("Removing Layer:" + layername);
    }
    // Creation of the Predicate
    EntryObject e = new PredicateBuilder().getEntryObject();
    Predicate predicate = e.get("layer_name").equal(layername);
    // Creation of the processor
    CacheEntryProcessor entryProcessor = new CacheEntryProcessor();
    // Execution of the Processor
    map.executeOnEntries(entryProcessor, predicate);
  } else {
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("Cache not configured");
    }
  }
}
origin: com.hazelcast/hazelcast-all

public PredicateBuilder between(Comparable from, Comparable to) {
  return addPredicate(Predicates.between(qb.getAttribute(), from, to));
}
com.hazelcast.queryPredicateBuilder

Javadoc

This class provides functionality to build predicate.

Most used methods

  • <init>
  • getEntryObject
  • and
  • getAttribute
  • setAttribute

Popular in Java

  • Updating database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • getSystemService (Context)
  • requestLocationUpdates (LocationManager)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Collectors (java.util.stream)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Option (scala)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now