Tabnine Logo
PredicateBuilder.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.hazelcast.query.PredicateBuilder
constructor

Best Java code snippets using com.hazelcast.query.PredicateBuilder.<init> (Showing top 12 results out of 315)

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: stackoverflow.com

EntryObject entryObject = new PredicateBuilder().getEntryObject();
PredicateBuilder builder = entryObject.key().get("date").isNull();
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: 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: 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: 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: 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: apifest/apifest-oauth20

@Override
@SuppressWarnings("unchecked")
public void removeUserTokens(String userId) {
  EntryObject eo = new PredicateBuilder().getEntryObject();
  Predicate<String, String> predicate = eo.get("userId").equal("userId");
  IMap<String, PersistentAccessToken> container = getAccessTokenContainer();
  Set<String> keys = container.keySet(predicate);
  if (!keys.isEmpty()) {
    for (String token : keys) {
      container.remove(token);
    }
  }
}
origin: com.hazelcast.simulator/tests-common

@TimeStep(prob = 0)
public void predicateBuilder(ThreadState state) {
  int id = state.randomInt(itemCount);
  EntryObject entryObject = new PredicateBuilder().getEntryObject();
  Predicate predicate = entryObject.get("id").equal(id);
  map.values(predicate);
}
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: 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 );
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);
}
com.hazelcast.queryPredicateBuilder<init>

Popular methods of PredicateBuilder

  • getEntryObject
  • and
  • getAttribute
  • setAttribute

Popular in Java

  • Reactive rest calls using spring rest template
  • putExtra (Intent)
  • onRequestPermissionsResult (Fragment)
  • getSharedPreferences (Context)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top plugins for WebStorm
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