-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dependabot/maven/org.apache.maven.plugins-maven-project…
…-info-reports-plugin-3.4.5' of github.com:parsingdata/metal into dependabot/maven/org.apache.maven.plugins-maven-project-info-reports-plugin-3.4.5
- Loading branch information
Showing
213 changed files
with
2,458 additions
and
1,333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
<parent> | ||
<groupId>io.parsingdata</groupId> | ||
<artifactId>metal</artifactId> | ||
<version>10.0.0-SNAPSHOT</version> | ||
<version>11.0.0-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>metal-core</artifactId> | ||
<name>${project.groupId}:${project.artifactId}</name> | ||
|
@@ -14,6 +14,7 @@ | |
<connection>scm:git:[email protected]:parsingdata/metal.git</connection> | ||
<developerConnection>scm:git:[email protected]:parsingdata/metal.git</developerConnection> | ||
<url>https://github.com/parsingdata/metal.git</url> | ||
<tag>HEAD</tag> | ||
</scm> | ||
|
||
<build> | ||
|
26 changes: 26 additions & 0 deletions
26
core/src/main/java/io/parsingdata/metal/ImmutableObject.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.parsingdata.metal; | ||
|
||
/** | ||
* When objects are immutable, that means their hash code will stay the same the moment it is created. | ||
* It will improve performance if these objects cache their hash code. | ||
* <p> | ||
* This is a lazy implementation, instead of calculating the hash once within the constructor, to avoid | ||
* performance decrease during parsing. In most implementations the hash code is not actually used/needed. | ||
*/ | ||
public abstract class ImmutableObject { | ||
|
||
private Integer hashCode; | ||
|
||
public abstract int immutableHashCode(); | ||
|
||
@Override | ||
public abstract boolean equals(final Object obj); | ||
|
||
@Override | ||
public int hashCode() { | ||
if (hashCode == null) { | ||
hashCode = immutableHashCode(); | ||
} | ||
return hashCode; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.