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

How to use
getEntryObject
method
in
com.hazelcast.query.PredicateBuilder

Best Java code snippets using com.hazelcast.query.PredicateBuilder.getEntryObject (Showing top 10 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: 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: 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: 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.queryPredicateBuildergetEntryObject

Popular methods of PredicateBuilder

  • <init>
  • and
  • getAttribute
  • setAttribute

Popular in Java

  • Parsing JSON documents to java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getResourceAsStream (ClassLoader)
  • putExtra (Intent)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Github Copilot alternatives
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