Skip to content

Commit 3de7c32

Browse files
authored
Merge pull request eugenp#8249 from catalin-burcea/BAEL-16531
[BAEL-16531] - Move all the existing articles on "optional" under jav…
2 parents 1e8dabe + 34e61ef commit 3de7c32

File tree

29 files changed

+230
-201
lines changed

29 files changed

+230
-201
lines changed

core-java-modules/core-java-11/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ This module contains articles about Java 11 core features
1212
- [An Introduction to Epsilon GC: A No-Op Experimental Garbage Collector](https://www.baeldung.com/jvm-epsilon-gc-garbage-collector)
1313
- [Guide to jlink](https://www.baeldung.com/jlink)
1414
- [Negate a Predicate Method Reference with Java 11](https://www.baeldung.com/java-negate-predicate-method-reference)
15-
- [Transforming an Empty String into an Empty Optional](https://www.baeldung.com/java-empty-string-to-empty-optional)

core-java-modules/core-java-8-2/src/main/resources/META-INF/persistence.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
version="2.0">
66

77
<persistence-unit
8-
name="com.baeldung.optionalReturnType"
8+
name="com.baeldung.optionalreturntype"
99
transaction-type="RESOURCE_LOCAL">
1010
<description>Persist Optional Return Type Demo</description>
1111
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
12-
<class>com.baeldung.optionalReturnType.User</class>
13-
<class>com.baeldung.optionalReturnType.UserOptional</class>
12+
<class>com.baeldung.optionalreturntype.User</class>
13+
<class>com.baeldung.optionalreturntype.UserOptional</class>
1414
<!--
15-
<class>com.baeldung.optionalReturnType.UserOptionalField</class>
15+
<class>com.baeldung.optionalreturntype.UserOptionalField</class>
1616
-->
1717
<exclude-unlisted-classes>true</exclude-unlisted-classes>
1818

core-java-modules/core-java-9-improvements/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ This module contains articles about the improvements to core Java features intro
55
### Relevant Articles:
66

77
- [New Stream Collectors in Java 9](http://www.baeldung.com/java9-stream-collectors)
8-
- [Java 9 Optional API Additions](https://www.baeldung.com/java-9-optional)
98
- [Java 9 Convenience Factory Methods for Collections](https://www.baeldung.com/java-9-collections-factory-methods)
109
- [Java 9 Stream API Improvements](https://www.baeldung.com/java-9-stream-api)
1110
- [Java 9 java.util.Objects Additions](https://www.baeldung.com/java-9-objects-new)

core-java-modules/core-java-9-improvements/src/test/java/com/baeldung/java9/Java9OptionalTest.java

Lines changed: 0 additions & 85 deletions
This file was deleted.

core-java-modules/core-java-9/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ This module contains articles about Java 9 core features
44

55
### Relevant Articles:
66

7-
- [Method Handles in Java](http://www.baeldung.com/java-method-handles)
8-
- [Introduction to Chronicle Queue](http://www.baeldung.com/java-chronicle-queue)
9-
- [Optional orElse Optional](http://www.baeldung.com/java-optional-or-else-optional)
7+
- [Method Handles in Java](https://www.baeldung.com/java-method-handles)
8+
- [Introduction to Chronicle Queue](https://www.baeldung.com/java-chronicle-queue)
109
- [Iterate Through a Range of Dates in Java](https://www.baeldung.com/java-iterate-date-range)
1110
- [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap)
1211
- [Immutable Set in Java](https://www.baeldung.com/java-immutable-set)
13-
- [Filtering a Stream of Optionals in Java](https://www.baeldung.com/java-filter-stream-of-optional)
1412

1513
Note: also contains part of the code for the article
1614
[How to Filter a Collection in Java](https://www.baeldung.com/java-collection-filtering).

core-java-modules/core-java-9/src/test/java/com/baeldung/optionals/OptionalsTest.java

Lines changed: 0 additions & 51 deletions
This file was deleted.

core-java-modules/core-java-exceptions/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ This module contains articles about core java exceptions
1515
- [Java – Try with Resources](https://www.baeldung.com/java-try-with-resources)
1616
- [Java Global Exception Handler](https://www.baeldung.com/java-global-exception-handler)
1717
- [Common Java Exceptions](https://www.baeldung.com/java-common-exceptions)
18-
- [Throw Exception in Optional in Java 8](https://www.baeldung.com/java-optional-throw-exception)
1918
- [How to Find an Exception’s Root Cause in Java](https://www.baeldung.com/java-exception-root-cause)
2019
- [Is It a Bad Practice to Catch Throwable?](https://www.baeldung.com/java-catch-throwable-bad-practice)
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
=========
1+
## Java Optional
22

3-
## Core Java Optional
3+
This module contains articles about Java Optional.
44

55
### Relevant Articles:
66
- [Java Optional as Return Type](https://www.baeldung.com/java-optional-return)
7-
- [Guide To Java 8 Optional](https://www.baeldung.com/java-optional)
8-
- [Java Optional – orElse() vs orElseGet()](https://www.baeldung.com/java-optional-or-else-vs-or-else-get)
7+
- [Guide to Java 8 Optional](https://www.baeldung.com/java-optional)
8+
- [Java Optional – orElse() vs orElseGet()](https://www.baeldung.com/java-optional-or-else-vs-or-else-get)
9+
- [Transforming an Empty String into an Empty Optional](https://www.baeldung.com/java-empty-string-to-empty-optional)
10+
- [Filtering a Stream of Optionals in Java](https://www.baeldung.com/java-filter-stream-of-optional)
11+
- [Java 9 Optional API Additions](https://www.baeldung.com/java-9-optional)
12+
- [Throw Exception in Optional in Java 8](https://www.baeldung.com/java-optional-throw-exception)
13+
- [Optional orElse Optional](https://www.baeldung.com/java-optional-or-else-optional)

core-java-modules/core-java-optional/pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,31 @@
4242
<artifactId>jmh-generator-bytecode</artifactId>
4343
<version>${jmh-generator.version}</version>
4444
</dependency>
45+
<dependency>
46+
<groupId>com.google.guava</groupId>
47+
<artifactId>guava</artifactId>
48+
<version>${guava.version}</version>
49+
</dependency>
50+
<dependency>
51+
<groupId>io.rest-assured</groupId>
52+
<artifactId>json-path</artifactId>
53+
<version>${rest-assured.version}</version>
54+
<scope>test</scope>
55+
</dependency>
56+
<dependency>
57+
<groupId>org.assertj</groupId>
58+
<artifactId>assertj-core</artifactId>
59+
<version>${assertj.version}</version>
60+
<scope>test</scope>
61+
</dependency>
4562
</dependencies>
4663

4764
<properties>
4865
<hibernate.core.version>5.4.0.Final</hibernate.core.version>
4966
<jmh-core.version>1.19</jmh-core.version>
5067
<jmh-generator.version>1.19</jmh-generator.version>
68+
<guava.version>27.1-jre</guava.version>
69+
<assertj.version>3.10.0</assertj.version>
70+
<rest-assured.version>3.1.1</rest-assured.version>
5171
</properties>
5272
</project>

core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/OrElseAndOrElseGet.java renamed to core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/orelse/OrElseAndOrElseGet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.baeldung.optional;
1+
package com.baeldung.optional.orelse;
22

33
import java.util.Arrays;
44
import java.util.List;

0 commit comments

Comments
 (0)