@Override
 public int hashCode() {
   return Objects.hashCode(event)
       ^ Objects.hashCode(event.getMessage())
       ^ Objects.hashCode(event.getPointOfFailure())
       ^ Arrays.hashCode(event.getStackTrace());
 }
Example #2
0
 @Override
 public int hashCode() {
   return Objects.hashCode(viewBindingTypeName)
       + Objects.hashCode(viewBindingObjectTypeName)
       + Objects.hashCode(viewType)
       + Objects.hashCode(simpleOneWayPropertyInfoList);
 }
Example #3
0
 @Benchmark
 int hashMixed_5(int reps) {
   int dummy = 0;
   for (int i = 0; i < reps; i++) {
     dummy += Objects.hashCode(I2, S1, D1, S2, I0);
     dummy += Objects.hashCode(D0, I1, S3, I2, S0);
   }
   return dummy;
 }
Example #4
0
 @Override
 public int hashCode() {
   return Objects.hashCode(
       indexName,
       indexPath,
       indexMethod,
       Objects.hashCode(keySortSpecs),
       isUnique,
       isClustered,
       targetRelationSchema);
 }
 @Override
 public void testHashCode() {
   table = ArrayTable.create(asList("foo", "bar"), asList(1, 3));
   table.put("foo", 1, 'a');
   table.put("bar", 1, 'b');
   table.put("foo", 3, 'c');
   int expected =
       Objects.hashCode("foo", 1, 'a')
           + Objects.hashCode("bar", 1, 'b')
           + Objects.hashCode("foo", 3, 'c')
           + Objects.hashCode("bar", 3, 0);
   assertEquals(expected, table.hashCode());
 }
Example #6
0
 @Override
 public int hashCode() {
   return Objects.hashCode(
       external,
       tableName,
       Objects.hashCode(tableElements),
       storageType,
       subquery,
       location,
       params,
       partition,
       ifNotExists);
 }
Example #7
0
 @Override
 public int hashCode() {
   if (mHashCode == 0) {
     mHashCode =
         super.hashCode()
             ^ Objects.hashCode(
                 signature,
                 mAutoAdvance,
                 mTransientAutoAdvance,
                 messageTextSize,
                 snapHeaders,
                 replyBehavior,
                 convListIcon,
                 convListAttachmentPreviews,
                 confirmDelete,
                 confirmArchive,
                 confirmSend,
                 defaultInbox,
                 forceReplyFromDefault,
                 maxAttachmentSize,
                 swipe,
                 priorityArrowsEnabled,
                 setupIntentUri,
                 conversationViewMode,
                 veiledAddressPattern,
                 moveToInbox);
   }
   return mHashCode;
 }
Example #8
0
    @Override
    public int hashCode() {
      // Pattern uses Object.hashCode, so we have to reach
      // inside to build a hashCode consistent with equals.

      return Objects.hashCode(pattern.pattern(), pattern.flags());
    }
Example #9
0
 @Override
 public int hashCode() {
   return hashcode != 0
       ? hashcode
       : (hashcode =
           Objects.hashCode(stack.getItem(), actualDamage(stack), stack.getTagCompound()));
 }
  private ApiElement(Optional<ApiElement> parent, String name, ApiElementType type) {
    this.parent = parent;
    this.name = name;
    this.type = type;
    this.hashCode = Objects.hashCode(parent, name, type);

    Preconditions.checkArgument(
        (name.length() == 0) == (type == ApiElementType.PACKAGE && !parent.isPresent()));
    Preconditions.checkArgument(!name.contains("."), name);
    Preconditions.checkArgument(parent.isPresent() || name.length() == 0);
    switch (type) {
      case CLASS:
        Preconditions.checkArgument(
            parent.get().type == ApiElementType.PACKAGE
                || parent.get().type == ApiElementType.CLASS);
        return;
      case CONSTRUCTOR:
        Preconditions.checkArgument(name.equals(CONSTRUCTOR_SPECIAL_METHOD_NAME));
        Preconditions.checkArgument(
            parent.isPresent() && parent.get().type == ApiElementType.CLASS);
        return;
      case FIELD:
      case METHOD:
        Preconditions.checkArgument(
            parent.isPresent() && parent.get().type == ApiElementType.CLASS);
        return;
      case PACKAGE:
        Preconditions.checkArgument(
            !parent.isPresent() || parent.get().type == ApiElementType.PACKAGE);
        return;
    }
    throw new AssertionError(type);
  }
Example #11
0
 @Benchmark
 int hashString_5(int reps) {
   int dummy = 0;
   for (int i = 0; i < reps; i++) {
     dummy += Objects.hashCode(S0, S1, S2, S3, S4);
   }
   return dummy;
 }
Example #12
0
 @Override
 public int hashCode() {
   return Objects.hashCode(
       comparator,
       getLowerEndpoint(),
       getLowerBoundType(),
       getUpperEndpoint(),
       getUpperBoundType());
 }
 public MyLocation(double latitude, double longitude) {
   Preconditions.checkArgument(Ranges.LATITUDE_RANGE.contains(latitude), "Invalid latitude");
   Preconditions.checkArgument(Ranges.LONGITUDE_RANGE.contains(longitude), "Invalid longitude");
   this.latitude = latitude;
   this.longitude = longitude;
   this.toString =
       String.format("lat: %s, lng: %s", String.valueOf(latitude), String.valueOf(longitude));
   this.hashCode = Objects.hashCode(latitude, longitude);
 }
 @Override
 public int hashCode() {
   return Objects.hashCode(
       super.hashCode(),
       autoAssignFloatingIp,
       securityGroupNames,
       generateKeyPair,
       keyPairName,
       userData);
 }
Example #15
0
 @Override
 public int hashCode() {
   return Objects.hashCode(
       this.id,
       this.sequence,
       this.menuCode,
       this.menuName,
       this.menuClass,
       this.dataUrl,
       this.parentMenuCode);
 }
Example #16
0
 @Override
 public int hashCode() {
   return Objects.hashCode(
       this.slug,
       this.title,
       this.onShelf,
       this.price,
       this.stock,
       this.featuredImageId,
       this.weight);
 }
 @Override
 protected String getInstallLabelExtraSalt() {
   String downloadUrl = entity.getConfig(BrooklynNode.DOWNLOAD_URL);
   String uploadUrl = entity.getConfig(BrooklynNode.DISTRO_UPLOAD_URL);
   if (Objects.equal(downloadUrl, BrooklynNode.DOWNLOAD_URL.getConfigKey().getDefaultValue())
       && Objects.equal(uploadUrl, BrooklynNode.DISTRO_UPLOAD_URL.getDefaultValue())) {
     // if both are at the default value, then no salt
     return null;
   }
   return Identifiers.makeIdFromHash(Objects.hashCode(downloadUrl, uploadUrl));
 }
Example #18
0
 @Override
 public int hashCode() {
   return Objects.hashCode(
       super.hashCode(),
       owner,
       children,
       sections,
       vAppScopedLocalId,
       ovfDescriptorUploaded,
       goldMaster);
 }
Example #19
0
 @Override
 public int hashCode() {
   return Objects.hashCode(
       networkConnectionIndex,
       ipAddress,
       externalIpAddress,
       isConnected,
       macAddress,
       ipAddressAllocationMode,
       network,
       needsCustomization);
 }
Example #20
0
 @Override
 public int hashCode() {
   return Objects.hashCode(
       getLanguage(),
       getNativeness(),
       getNameStatus(),
       getGrammaticalNumber(),
       getGrammaticalGender(),
       getPronunciation(),
       getSourceOfName(),
       getSpelling());
 }
 @Override
 public int hashCode() {
   return Objects.hashCode(
       url,
       browserConfig,
       plugins,
       proxyConfiguration,
       crawlRules,
       maximumStates,
       maximumRuntime,
       maximumDepth);
 }
Example #22
0
 @Override
 public int hashCode() {
   return Objects.hashCode(
       super.hashCode(),
       resourceGuaranteedMemory,
       resourceGuaranteedCpu,
       vCpuInMhz,
       isThinProvision,
       networkPoolReference,
       providerVdcReference,
       usesFastProvisioning);
 }
Example #23
0
 @Override
 public int hashCode() {
   return Objects.hashCode(
       super.hashCode(),
       links,
       deploymentLeaseInSeconds,
       storageLeaseInSeconds,
       deploymentLeaseExpiration,
       storageLeaseExpiration,
       href,
       type);
 }
Example #24
0
  public static void main(String[] args) {
    System.out.println(Objects.equal("a", "a")); // returns true
    System.out.println(Objects.equal(null, "a")); // returns false
    System.out.println(Objects.equal("a", null)); // returns false
    System.out.println(Objects.equal(null, null)); // returns true

    System.out.println(Objects.hashCode(1, 2, 3));

    toStringHelper();

    System.out.println(MoreObjects.firstNonNull(null, 1));
  }
Example #25
0
 SimulationTask(
     long randomSeed, String scenId, String configId, String objFuncId, String postProcId) {
   seed = randomSeed;
   scenarioId = scenId;
   configurationId = configId;
   objectiveFunctionId = objFuncId;
   postProcessorId = postProcId;
   id =
       Joiner.on("-")
           .join(seed, scenarioId, configurationId, objectiveFunctionId, postProcessorId);
   hashCode =
       Objects.hashCode(seed, scenarioId, configurationId, objectiveFunctionId, postProcessorId);
 }
Example #26
0
  @Override
  public int hashCode() {
    int hashCode = Objects.hashCode(getRoleName());
    if (previousHashCode != 0 && previousHashCode != hashCode) {
      log.warn(
          "DEVELOPER: hashCode has changed!." //
              + "If you encounter this message you should take the time to carefuly review equals/hashCode for: " //
              + getClass().getCanonicalName());
    }

    previousHashCode = hashCode;
    return hashCode;
  }
 @Override
 public int hashCode() {
   return Objects.hashCode(
       self,
       issueUri,
       author,
       updateAuthor,
       comment,
       creationDate,
       updateDate,
       startDate,
       minutesSpent);
 }
 @Override
 public int hashCode() {
   return Objects.hashCode(
       group,
       name,
       version,
       classifier,
       configuration,
       exclusions,
       extraOptions,
       optional,
       transitive);
 }
 @Override
 public int hashCode() {
   return Objects.hashCode(
       streetNumber,
       streetNumberPostfix,
       streetName,
       streetPreDirection,
       streetPostDirection,
       streetTypeAbbreviation,
       localityName,
       regionCode,
       postalCode,
       countryAlpha2Code);
 }
 @Override
 public int hashCode() {
   return Objects.hashCode(
       super.hashCode(),
       volumes,
       hostname,
       dns,
       memory,
       commands,
       cpuShares,
       env,
       portBindings,
       extraHosts);
 }