From b1e507d44c3c44d2b1625d27a75dc4726926b38e Mon Sep 17 00:00:00 2001 From: dupirefr Date: Sat, 4 Apr 2020 11:38:22 +0200 Subject: [PATCH] [JAVA-621] core-java-lang-oop-methods module * Creation * Moved code from https://www.baeldung.com/java-equals-hashcode-contracts * Moved code from www.baeldung.com/java-hashcode * Moved code from https://www.baeldung.com/java-method-overload-override * Moved code from www.baeldung.com/java-methods * Moved article references to the new README.md --- .../core-java-lang-oop-2/README.md | 1 - .../core-java-lang-oop-4/README.md | 1 - .../core-java-lang-oop-methods/README.md | 9 +++++ .../core-java-lang-oop-methods/pom.xml | 35 +++++++++++++++++++ .../com/baeldung/basicmethods/PersonName.java | 0 .../com/baeldung/equalshashcode/Money.java | 0 .../com/baeldung/equalshashcode/Team.java | 0 .../com/baeldung/equalshashcode/Voucher.java | 0 .../baeldung/equalshashcode/WrongTeam.java | 0 .../baeldung/equalshashcode/WrongVoucher.java | 0 .../com/baeldung/hashcode/entities/User.java | 0 .../application/Application.java | 0 .../model/Car.java | 0 .../model/Vehicle.java | 0 .../util/Multiplier.java | 0 .../equalshashcode/MoneyUnitTest.java | 0 .../baeldung/equalshashcode/TeamUnitTest.java | 0 .../application/ApplicationUnitTest.java | 0 .../hashcode/entities/UserUnitTest.java | 0 .../test/MethodOverloadingUnitTest.java | 0 .../test/MethodOverridingUnitTest.java | 0 .../core-java-lang-oop-modules/pom.xml | 1 + .../core-java-lang-oop/README.md | 2 -- 23 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/README.md create mode 100644 core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/pom.xml rename core-java-modules/{core-java-lang-oop-4 => core-java-lang-oop-modules/core-java-lang-oop-methods}/src/main/java/com/baeldung/basicmethods/PersonName.java (100%) rename core-java-modules/{core-java-lang-oop-2 => core-java-lang-oop-modules/core-java-lang-oop-methods}/src/main/java/com/baeldung/equalshashcode/Money.java (100%) rename core-java-modules/{core-java-lang-oop-2 => core-java-lang-oop-modules/core-java-lang-oop-methods}/src/main/java/com/baeldung/equalshashcode/Team.java (100%) rename core-java-modules/{core-java-lang-oop-2 => core-java-lang-oop-modules/core-java-lang-oop-methods}/src/main/java/com/baeldung/equalshashcode/Voucher.java (100%) rename core-java-modules/{core-java-lang-oop-2 => core-java-lang-oop-modules/core-java-lang-oop-methods}/src/main/java/com/baeldung/equalshashcode/WrongTeam.java (100%) rename core-java-modules/{core-java-lang-oop-2 => core-java-lang-oop-modules/core-java-lang-oop-methods}/src/main/java/com/baeldung/equalshashcode/WrongVoucher.java (100%) rename core-java-modules/{core-java-lang-oop => core-java-lang-oop-modules/core-java-lang-oop-methods}/src/main/java/com/baeldung/hashcode/entities/User.java (100%) rename core-java-modules/{core-java-lang-oop => core-java-lang-oop-modules/core-java-lang-oop-methods}/src/main/java/com/baeldung/methodoverloadingoverriding/application/Application.java (100%) rename core-java-modules/{core-java-lang-oop => core-java-lang-oop-modules/core-java-lang-oop-methods}/src/main/java/com/baeldung/methodoverloadingoverriding/model/Car.java (100%) rename core-java-modules/{core-java-lang-oop => core-java-lang-oop-modules/core-java-lang-oop-methods}/src/main/java/com/baeldung/methodoverloadingoverriding/model/Vehicle.java (100%) rename core-java-modules/{core-java-lang-oop => core-java-lang-oop-modules/core-java-lang-oop-methods}/src/main/java/com/baeldung/methodoverloadingoverriding/util/Multiplier.java (100%) rename core-java-modules/{core-java-lang-oop-2 => core-java-lang-oop-modules/core-java-lang-oop-methods}/src/test/java/com/baeldung/equalshashcode/MoneyUnitTest.java (100%) rename core-java-modules/{core-java-lang-oop-2 => core-java-lang-oop-modules/core-java-lang-oop-methods}/src/test/java/com/baeldung/equalshashcode/TeamUnitTest.java (100%) rename core-java-modules/{core-java-lang-oop => core-java-lang-oop-modules/core-java-lang-oop-methods}/src/test/java/com/baeldung/hashcode/application/ApplicationUnitTest.java (100%) rename core-java-modules/{core-java-lang-oop => core-java-lang-oop-modules/core-java-lang-oop-methods}/src/test/java/com/baeldung/hashcode/entities/UserUnitTest.java (100%) rename core-java-modules/{core-java-lang-oop => core-java-lang-oop-modules/core-java-lang-oop-methods}/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverloadingUnitTest.java (100%) rename core-java-modules/{core-java-lang-oop => core-java-lang-oop-modules/core-java-lang-oop-methods}/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverridingUnitTest.java (100%) diff --git a/core-java-modules/core-java-lang-oop-2/README.md b/core-java-modules/core-java-lang-oop-2/README.md index 2f122ab624..5385977ef0 100644 --- a/core-java-modules/core-java-lang-oop-2/README.md +++ b/core-java-modules/core-java-lang-oop-2/README.md @@ -3,5 +3,4 @@ This module contains articles about Object-oriented programming (OOP) in Java ### Relevant Articles: -- [Java equals() and hashCode() Contracts](https://www.baeldung.com/java-equals-hashcode-contracts) - [[<-- Prev]](/core-java-modules/core-java-lang-oop)[[More -->]](/core-java-modules/core-java-lang-oop-3) diff --git a/core-java-modules/core-java-lang-oop-4/README.md b/core-java-modules/core-java-lang-oop-4/README.md index 51650dc1f6..efddf9df8a 100644 --- a/core-java-modules/core-java-lang-oop-4/README.md +++ b/core-java-modules/core-java-lang-oop-4/README.md @@ -4,6 +4,5 @@ This module contains articles about Object-oriented programming (OOP) in Java ### Relevant Articles: - [Static and Dynamic Binding in Java](https://www.baeldung.com/java-static-dynamic-binding) -- [Methods in Java](https://www.baeldung.com/java-methods) - [Java ‘private’ Access Modifier](https://www.baeldung.com/java-private-keyword) - [[<-- Prev]](/core-java-modules/core-java-lang-oop-3) \ No newline at end of file diff --git a/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/README.md b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/README.md new file mode 100644 index 0000000000..fa474c9795 --- /dev/null +++ b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/README.md @@ -0,0 +1,9 @@ +## Core Java Lang OOP - Methods + +This module contains articles about methods in Java + +### Relevant Articles: +- [Methods in Java](https://www.baeldung.com/java-methods) +- [Method Overloading and Overriding in Java](https://www.baeldung.com/java-method-overload-override) +- [Java equals() and hashCode() Contracts](https://www.baeldung.com/java-equals-hashcode-contracts) +- [Guide to hashCode() in Java](https://www.baeldung.com/java-hashcode) diff --git a/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/pom.xml b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/pom.xml new file mode 100644 index 0000000000..062af9c3cd --- /dev/null +++ b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/pom.xml @@ -0,0 +1,35 @@ + + + + core-java-lang-oop-modules + com.baeldung.core-java-lang-oop-modules + 1.0.0-SNAPSHOT + + 4.0.0 + + core-java-lang-oop-methods + core-java-lang-oop-methods + jar + + + + org.assertj + assertj-core + ${assertj-core.version} + test + + + nl.jqno.equalsverifier + equalsverifier + ${equalsverifier.version} + test + + + + + 3.10.0 + 3.0.3 + + \ No newline at end of file diff --git a/core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/basicmethods/PersonName.java b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/basicmethods/PersonName.java similarity index 100% rename from core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/basicmethods/PersonName.java rename to core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/basicmethods/PersonName.java diff --git a/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/equalshashcode/Money.java b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/equalshashcode/Money.java similarity index 100% rename from core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/equalshashcode/Money.java rename to core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/equalshashcode/Money.java diff --git a/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/equalshashcode/Team.java b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/equalshashcode/Team.java similarity index 100% rename from core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/equalshashcode/Team.java rename to core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/equalshashcode/Team.java diff --git a/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/equalshashcode/Voucher.java b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/equalshashcode/Voucher.java similarity index 100% rename from core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/equalshashcode/Voucher.java rename to core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/equalshashcode/Voucher.java diff --git a/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/equalshashcode/WrongTeam.java b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/equalshashcode/WrongTeam.java similarity index 100% rename from core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/equalshashcode/WrongTeam.java rename to core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/equalshashcode/WrongTeam.java diff --git a/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/equalshashcode/WrongVoucher.java b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/equalshashcode/WrongVoucher.java similarity index 100% rename from core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/equalshashcode/WrongVoucher.java rename to core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/equalshashcode/WrongVoucher.java diff --git a/core-java-modules/core-java-lang-oop/src/main/java/com/baeldung/hashcode/entities/User.java b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/hashcode/entities/User.java similarity index 100% rename from core-java-modules/core-java-lang-oop/src/main/java/com/baeldung/hashcode/entities/User.java rename to core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/hashcode/entities/User.java diff --git a/core-java-modules/core-java-lang-oop/src/main/java/com/baeldung/methodoverloadingoverriding/application/Application.java b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/methodoverloadingoverriding/application/Application.java similarity index 100% rename from core-java-modules/core-java-lang-oop/src/main/java/com/baeldung/methodoverloadingoverriding/application/Application.java rename to core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/methodoverloadingoverriding/application/Application.java diff --git a/core-java-modules/core-java-lang-oop/src/main/java/com/baeldung/methodoverloadingoverriding/model/Car.java b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/methodoverloadingoverriding/model/Car.java similarity index 100% rename from core-java-modules/core-java-lang-oop/src/main/java/com/baeldung/methodoverloadingoverriding/model/Car.java rename to core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/methodoverloadingoverriding/model/Car.java diff --git a/core-java-modules/core-java-lang-oop/src/main/java/com/baeldung/methodoverloadingoverriding/model/Vehicle.java b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/methodoverloadingoverriding/model/Vehicle.java similarity index 100% rename from core-java-modules/core-java-lang-oop/src/main/java/com/baeldung/methodoverloadingoverriding/model/Vehicle.java rename to core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/methodoverloadingoverriding/model/Vehicle.java diff --git a/core-java-modules/core-java-lang-oop/src/main/java/com/baeldung/methodoverloadingoverriding/util/Multiplier.java b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/methodoverloadingoverriding/util/Multiplier.java similarity index 100% rename from core-java-modules/core-java-lang-oop/src/main/java/com/baeldung/methodoverloadingoverriding/util/Multiplier.java rename to core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/methodoverloadingoverriding/util/Multiplier.java diff --git a/core-java-modules/core-java-lang-oop-2/src/test/java/com/baeldung/equalshashcode/MoneyUnitTest.java b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/test/java/com/baeldung/equalshashcode/MoneyUnitTest.java similarity index 100% rename from core-java-modules/core-java-lang-oop-2/src/test/java/com/baeldung/equalshashcode/MoneyUnitTest.java rename to core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/test/java/com/baeldung/equalshashcode/MoneyUnitTest.java diff --git a/core-java-modules/core-java-lang-oop-2/src/test/java/com/baeldung/equalshashcode/TeamUnitTest.java b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/test/java/com/baeldung/equalshashcode/TeamUnitTest.java similarity index 100% rename from core-java-modules/core-java-lang-oop-2/src/test/java/com/baeldung/equalshashcode/TeamUnitTest.java rename to core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/test/java/com/baeldung/equalshashcode/TeamUnitTest.java diff --git a/core-java-modules/core-java-lang-oop/src/test/java/com/baeldung/hashcode/application/ApplicationUnitTest.java b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/test/java/com/baeldung/hashcode/application/ApplicationUnitTest.java similarity index 100% rename from core-java-modules/core-java-lang-oop/src/test/java/com/baeldung/hashcode/application/ApplicationUnitTest.java rename to core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/test/java/com/baeldung/hashcode/application/ApplicationUnitTest.java diff --git a/core-java-modules/core-java-lang-oop/src/test/java/com/baeldung/hashcode/entities/UserUnitTest.java b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/test/java/com/baeldung/hashcode/entities/UserUnitTest.java similarity index 100% rename from core-java-modules/core-java-lang-oop/src/test/java/com/baeldung/hashcode/entities/UserUnitTest.java rename to core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/test/java/com/baeldung/hashcode/entities/UserUnitTest.java diff --git a/core-java-modules/core-java-lang-oop/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverloadingUnitTest.java b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverloadingUnitTest.java similarity index 100% rename from core-java-modules/core-java-lang-oop/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverloadingUnitTest.java rename to core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverloadingUnitTest.java diff --git a/core-java-modules/core-java-lang-oop/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverridingUnitTest.java b/core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverridingUnitTest.java similarity index 100% rename from core-java-modules/core-java-lang-oop/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverridingUnitTest.java rename to core-java-modules/core-java-lang-oop-modules/core-java-lang-oop-methods/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverridingUnitTest.java diff --git a/core-java-modules/core-java-lang-oop-modules/pom.xml b/core-java-modules/core-java-lang-oop-modules/pom.xml index 3f33150424..369195d477 100644 --- a/core-java-modules/core-java-lang-oop-modules/pom.xml +++ b/core-java-modules/core-java-lang-oop-modules/pom.xml @@ -21,5 +21,6 @@ core-java-lang-oop-modifiers core-java-lang-oop-types core-java-lang-oop-inheritance + core-java-lang-oop-methods \ No newline at end of file diff --git a/core-java-modules/core-java-lang-oop/README.md b/core-java-modules/core-java-lang-oop/README.md index 7855fb7b7e..f7e00e44eb 100644 --- a/core-java-modules/core-java-lang-oop/README.md +++ b/core-java-modules/core-java-lang-oop/README.md @@ -3,8 +3,6 @@ This module contains articles about Object-oriented programming (OOP) in Java ### Relevant Articles: -- [Guide to hashCode() in Java](https://www.baeldung.com/java-hashcode) -- [Method Overloading and Overriding in Java](https://www.baeldung.com/java-method-overload-override) - [How to Make a Deep Copy of an Object in Java](https://www.baeldung.com/java-deep-copy) - [Type Erasure in Java Explained](https://www.baeldung.com/java-type-erasure) - [Object-Oriented-Programming Concepts in Java](https://www.baeldung.com/java-oop)