Java Code Examples for java.util.Map.hashCode()

The following are Jave code examples for showing how to use hashCode() of the java.util.Map class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: android-mobile-engage-sdk   File: MobileEngageInternal.java   Source Code and License Vote up 6 votes
String appLogin() {
    EMSLogger.log(MobileEngageTopic.MOBILE_ENGAGE, "Called");

    RequestModel model;
    Map<String, Object> payload = injectLoginPayload(RequestUtils.createBasePayload(config, appLoginParameters));

    Integer storedHashCode = appLoginStorage.get();
    int currentHashCode = payload.hashCode();

    if (storedHashCode == null || currentHashCode != storedHashCode) {
        model = new RequestModel.Builder()
                .url(ME_LOGIN_V2)
                .payload(payload)
                .build();
        appLoginStorage.set(currentHashCode);
    } else {
        model = new RequestModel.Builder()
                .url(ME_LAST_MOBILE_ACTIVITY_V2)
                .payload(RequestUtils.createBasePayload(config, appLoginParameters))
                .build();
    }

    MobileEngageUtils.incrementIdlingResource();
    manager.submit(model);
    return model.getId();
}
 
Example 2
Project: businessworks   File: ProxyFactory.java   Source Code and License Vote up 5 votes
IndicesCallbackFilter(List<Method> methods) {
  final Map<Object, Integer> indices = Maps.newHashMap();
  for (int i = 0; i < methods.size(); i++) {
    indices.put(MethodWrapper.create(methods.get(i)), i);
  }
  this.indices = indices;
  this.hashCode = indices.hashCode();
}