Skip to content

Commit

Permalink
Released 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis committed Sep 9, 2018
1 parent 6139f83 commit af1d7cb
Show file tree
Hide file tree
Showing 191 changed files with 15,654 additions and 8,838 deletions.
128 changes: 128 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,133 @@
# Changelog

## 1.2.0 _(2018-09-10)_

**crypto**
- Renamed the _security_ package to _crypto_

**io.bytes**
- Added _UncheckedInputStream_ and _UncheckedOutputStream_ classes

**io.bytes.InputStreams**
- Added the _of(Path)_ method
- Removed the _ENDLESS_ attribute

**io.bytes.OutputStreams**
- Added the _of(Path)_ method
- Renamed the _BLANK_ attribute to _EMPTY_
- Renamed the _nullToBlank()_ method to _nullToEmpty()_

**io.chars**
- Added _UncheckedReader_ and _UncheckedWriter_ classes

**io.chars.Readers**
- Added _of(Path)_ and _of(Path, Charset)_ methods
- Removed the _ENDLESS_ attribute

**io.chars.Writers**
- Added _of(Path)_ and _of(Path, Charset)_ methods
- Renamed the _BLANK_ attribute to _EMPTY_
- Renamed the _nullToBlank()_ method to _nullToEmpty()_

**io.lines**
- Added _UncheckedLineReader_ and _UncheckedLineWriter_ classes

**lang.Strings**
- Added _nullToEmpty(String)_, _emptyToNull(String)_, _blankToNull(String)_ and _blankToEmpty(String)_ methods
- Added the _isEmpty()_ method
- Added _isBoolean()_, _isShort()_, _isInt()_, _isLong()_, _isFloat()_, _isDouble()_, _isBinary()_, _isOctal()_ and _isDecimal()_ methods
- Changed _isBase64(CharSequence, boolean)_ and _isBase64Url(CharSequence, boolean)_ methods
- Added _quote(char)_, _quote(char, char, char)_, _unquoteChar(CharSequence)_ and _unquoteChar(CharSequence, char, char)_ methods
- Removed _quote(Object)_ and _quote(Object, char, char)_ methods

**lang.array.BooleanArrays**
- Added the _isEmpty()_ method
- Added _shuffle()_, _reverse()_, _reorder()_ and _swap()_ methods
- Added _of(Boolean[])_ and _toBoxed()_ methods
- Changed _containsAny()_, _containsAll()_, _containsOnce()_ and _containsOnly()_ methods

**lang.array.ByteArrays**
- Added the _isEmpty()_ method
- Added _shuffle()_, _reverse()_, _reorder()_ and _swap()_ methods
- Added _of(Byte[])_ and _toBoxed()_ methods
- Added _ofBinaryString()_ and _toBinaryString()_ methods
- Changed _containsAny()_, _containsAll()_, _containsOnce()_ and _containsOnly()_ methods

**lang.array.CharArrays**
- Added the _isEmpty()_ method
- Added _shuffle()_, _reverse()_, _reorder()_ and _swap()_ methods
- Added _of(Char[])_ and _toBoxed()_ methods
- Changed _containsAny()_, _containsAll()_, _containsOnce()_ and _containsOnly()_ methods

**lang.array.DoubleArrays**
- Added the _isEmpty()_ method
- Added _shuffle()_, _reverse()_, _reorder()_ and _swap()_ methods
- Added _of(Double[])_ and _toBoxed()_ methods
- Changed _containsAny()_, _containsAll()_, _containsOnce()_ and _containsOnly()_ methods

**lang.array.FloatArrays**
- Added the _isEmpty()_ method
- Added _shuffle()_, _reverse()_, _reorder()_ and _swap()_ methods
- Added _of(Float[])_ and _toBoxed()_ methods
- Changed _containsAny()_, _containsAll()_, _containsOnce()_ and _containsOnly()_ methods

**lang.array.IntArrays**
- Added the _isEmpty()_ method
- Added _shuffle()_, _reverse()_, _reorder()_ and _swap()_ methods
- Added _of(Integer[])_ and _toBoxed()_ methods
- Changed _containsAny()_, _containsAll()_, _containsOnce()_ and _containsOnly()_ methods

**lang.array.LongArrays**
- Added the _isEmpty()_ method
- Added _shuffle()_, _reverse()_, _reorder()_ and _swap()_ methods
- Added _of(Long[])_ and _toBoxed()_ methods
- Changed _containsAny()_, _containsAll()_, _containsOnce()_ and _containsOnly()_ methods

**lang.array.ObjectArrays**
- Added the _isEmpty()_ method
- Added _shuffle()_, _reverse()_, _reorder()_ and _swap()_ methods
- Added _concat()_ and _join()_ methods
- Added the _singleton(Class, Object)_ method
- Changed _containsAny()_, _containsAll()_, _containsOnce()_ and _containsOnly()_ methods

**lang.array.ShortArrays**
- Added the _isEmpty()_ method
- Added _shuffle()_, _reverse()_, _reorder()_ and _swap()_ methods
- Added the _singleton(Class, Object)_ method
- Added _of(Short[])_ and _toBoxed()_ methods
- Changed _containsAny()_, _containsAll()_, _containsOnce()_ and _containsOnly()_ methods

**misc**
- Added the _BloomFilter_ class

**misc.trees**
- Added _TreeNode_ and _LinkedTreeNode_ classes

**util.function.Consumers**
- Added the _distinct()_ method

**util.function.Suppliers**
- Renamed _cached()_ methods to _cache()_

**util.iteration**
- Added the _FilterIterator_ class
- Added the _IndexedElement_ class

**util.iteration.Iterables**
- Added _nullToEmpty(PrimitiveIterable)_ methods
- Added the _index()_ method
- Added _getFirst()_ and _getLast()_ methods
- Added the _wrap(Stream)_ method

**util.iteration.Iterators**
- Added _nullToEmpty(PrimitiveIterator)_ and _emptyToNull(PrimitiveIterator)_ methods
- Added the _isEmpty()_ method
- Added the _index()_ method
- Added _getFirst()_ and _getLast()_ methods
- Added _removeAll()_ and _removeIf()_ methods
- Removed the _toEnumeration()_ method


## 1.1.0 _(2018-06-20)_

**io.bytes.InputStreams**
Expand Down
30 changes: 17 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A _Java 10_ lightweight utility library to enhance the Java standard API.

## Introduction
**Javanilla** has been made to improve the developer experience with Java, in fact it provides lot of easy-to-use
components for commons usages. Its goal is not to replace popular utility libraries such as _Apache Commons_ Lang or
components for commons usages. Its goal is not to replace popular utility libraries such as _Apache Commons_ or
_Google Guava_ because it is not as much complete or reliable, but Javanilla is composed of some original tools that
could complete them.

Expand All @@ -20,14 +20,14 @@ To include and use Javanilla, you need to add the following dependency into your
<dependency>
<groupId>com.github.alexisjehan</groupId>
<artifactId>javanilla</artifactId>
<version>1.1.0</version>
<version>1.2.0</version>
</dependency>
```

Or if you are using _Gradle_:
```xml
dependencies {
compile "com.github.alexisjehan:javanilla:1.1.0"
compile "com.github.alexisjehan:javanilla:1.2.0"
}
```

Expand Down Expand Up @@ -73,6 +73,7 @@ try (final var lineReader = new LineReader(unixFilePath, LineSeparator.LF, ignor
_String_ and _CharSequence_ utility tools:
```java
System.out.println(Strings.blankToEmpty(" ")); // Prints an empty String
System.out.println(Strings.quote("A quoted String with an escaped \" double quote")); // Prints "A quoted String with an escaped \" double quote"
final var times = 5;
System.out.println(Strings.repeat("xX", times)); // Prints "xXxXxXxXxX"
final var size = 5;
Expand All @@ -81,7 +82,8 @@ System.out.println(Strings.removeEnd("foo", 'o')); // Prints "fo"
System.out.println(Strings.replaceLast("foo", 'o', 'r')); // Prints "for"
System.out.println(Strings.concatMerge("Once upon a time ...", "... the end")); // Prints "Once upon a time ... the end"
System.out.println(Strings.isHex(ByteArrays.toHexString("foo".getBytes())) ? "yes" : "no"); // Prints "yes"
System.out.println(Strings.isBase64(Base64.getEncoder().encodeToString("foo".getBytes())) ? "yes" : "no"); // Prints "yes"
final var withPadding = true;
System.out.println(Strings.isBase64(Base64.getEncoder().encodeToString("foo".getBytes()), withPadding) ? "yes" : "no"); // Prints "yes"
```

_Throwable_ utility tools:
Expand All @@ -95,7 +97,7 @@ try {
throw new IOException("A checked Exception inside a lambda");
});
} catch (final UncheckedIOException e) {
System.out.println(Throwables.getRootCause(e).getMessage()); // Prints "A checked Exception inside a lambda"
System.out.println(Throwables.getRootCause(e).orElseThrow().getMessage()); // Prints "A checked Exception inside a lambda"
}
```

Expand Down Expand Up @@ -182,33 +184,35 @@ System.out.println(countIterator.getCount()); // Prints 4
```

## Recurrent functions availability
| | InputStreams | OutputStreams | Readers | Writers | Strings | XxxArrays |
| | InputStreams | OutputStreams | Readers | Writers | Strings | ???Arrays |
| :------------: | :----------: | :-----------: | :------: | :-----------: | :------: | :--------: |
| EMPTY | &#x2713; | _BLANK_ | &#x2713; | _BLANK_ | &#x2713; | &#x2713; |
| ENDLESS | &#x2713; | | &#x2713; | | | |
| nullToEmpty | &#x2713; | _nullToBlank_ | &#x2713; | _nullToBlank_ | &#x2713; | &#x2713; |
| EMPTY | &#x2713; | &#x2713; | &#x2713; | &#x2713; | &#x2713; | &#x2713; |
| nullToEmpty | &#x2713; | &#x2713; | &#x2713; | &#x2713; | &#x2713; | &#x2713; |
| nullToDefault | &#x2713; | &#x2713; | &#x2713; | &#x2713; | &#x2713; | &#x2713; |
| emptyToNull | | | | | &#x2713; | &#x2713; |
| emptyToDefault | | | | | &#x2713; | &#x2713; |
| isEmpty | | | | | &#x2713; | &#x2713; |
| buffered | &#x2713; | &#x2713; | &#x2713; | &#x2713; | | |
| uncloseable | &#x2713; | &#x2713; | &#x2713; | &#x2713; | | |
| length | &#x2713; | | &#x2713; | | | |
| concat | &#x2713; | | &#x2713; | | | &#x2713; |
| join | &#x2713; | | &#x2713; | | | &#x2713; |
| tee | | &#x2713; | | &#x2713; | | |
| singleton | &#x2713; | | &#x2713; | | | &#x2713; |
| of | &#x2713; | | &#x2713; | | &#x2713; | &#x2713; |
| of | &#x2713; | &#x2713; | &#x2713; | &#x2713; | &#x2713; | &#x2713; |

| | Lists | Sets | Maps | Bags | Iterables | Iterators |
| :------------: | :------: | :---------: | :----------------: | :------: | :-------: | :-------: |
| empty | | | | &#x2713; | &#x2713; | &#x2713; |
| empty | | | | &#x2713; | &#x2713; | |
| nullToEmpty | &#x2713; | &#x2713; | &#x2713; | &#x2713; | &#x2713; | &#x2713; |
| nullToDefault | &#x2713; | &#x2713; | &#x2713; | &#x2713; | &#x2713; | &#x2713; |
| emptyToNull | &#x2713; | &#x2713; | &#x2713; | &#x2713; | &#x2713; | &#x2713; |
| emptyToDefault | &#x2713; | &#x2713; | &#x2713; | &#x2713; | &#x2713; | &#x2713; |
| emptyToNull | &#x2713; | &#x2713; | &#x2713; | &#x2713; | | &#x2713; |
| emptyToDefault | &#x2713; | &#x2713; | &#x2713; | &#x2713; | | &#x2713; |
| unmodifiable | | | | &#x2713; | &#x2713; | &#x2713; |
| length | | | | | &#x2713; | &#x2713; |
| concat | | | | | &#x2713; | &#x2713; |
| join | | | | | &#x2713; | &#x2713; |
| singleton | | | | &#x2713; | &#x2713; | &#x2713; |
| of | | _ofOrdered_ | _ofEntriesOrdered_ | &#x2713; | &#x2713; | &#x2713; |

## Maven phases and goals
Expand Down
34 changes: 11 additions & 23 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.github.alexisjehan</groupId>
<artifactId>javanilla</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.3.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Javanilla</name>
Expand Down Expand Up @@ -67,22 +67,21 @@

<dependencies>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>16.0.2</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.3.0</version>
<scope>test</scope>
</dependency>

<!-- Tests -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.2.0</version>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.10.0</version>
<version>3.11.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -100,8 +99,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<version>3.8.0</version>
<configuration>
<compilerArgument>-Xlint:unchecked</compilerArgument>
<excludes>
<exclude>**/benchmarks/**</exclude>
<exclude>**/examples/**</exclude>
Expand All @@ -112,18 +112,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.2.0</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -173,7 +161,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.1</version>
<version>0.8.2</version>
<configuration>
<excludes>
<exclude>**/benchmarks/**</exclude>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ of this software and associated documentation files (the "Software"), to deal
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
package com.github.alexisjehan.javanilla.security;
package com.github.alexisjehan.javanilla.crypto;

import javax.crypto.Cipher;
import javax.crypto.NoSuchPaddingException;
Expand Down Expand Up @@ -179,8 +179,8 @@ public static Cipher getRsaEcbOaepSha256AndMgf1Instance() {
/**
* <p>Get a new {@code Cipher} instance without throwing {@code NoSuchAlgorithmException} or
* {@code NoSuchPaddingException}.</p>
* @param algorithm the {@code Cipher} provided algorithm
* @return a {@code Cipher} instance of the provided standard algorithm
* @param algorithm the {@code Cipher} algorithm
* @return a {@code Cipher} instance of the provided algorithm
* @since 1.0.0
*/
private static Cipher getInstance(final String algorithm) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ of this software and associated documentation files (the "Software"), to deal
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
package com.github.alexisjehan.javanilla.security;
package com.github.alexisjehan.javanilla.crypto;

import javax.crypto.Mac;
import java.security.NoSuchAlgorithmException;
Expand Down Expand Up @@ -69,8 +69,8 @@ public static Mac getHmacSha256Instance() {

/**
* <p>Get a new {@code Mac} instance without throwing {@code NoSuchAlgorithmException}.</p>
* @param algorithm the {@code Mac} provided algorithm
* @return a {@code Mac} instance of the provided standard algorithm
* @param algorithm the {@code Mac} algorithm
* @return a {@code Mac} instance of the provided algorithm
* @since 1.1.0
*/
private static Mac getInstance(final String algorithm) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ of this software and associated documentation files (the "Software"), to deal
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
package com.github.alexisjehan.javanilla.security;
package com.github.alexisjehan.javanilla.crypto;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
Expand Down Expand Up @@ -69,8 +69,8 @@ public static MessageDigest getSha256Instance() {

/**
* <p>Get a new {@code MessageDigest} instance without throwing {@code NoSuchAlgorithmException}.</p>
* @param algorithm the {@code MessageDigest} provided algorithm
* @return a {@code MessageDigest} instance of the provided standard algorithm
* @param algorithm the {@code MessageDigest} algorithm
* @return a {@code MessageDigest} instance of the provided algorithm
* @since 1.0.0
*/
private static MessageDigest getInstance(final String algorithm) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ of this software and associated documentation files (the "Software"), to deal
SOFTWARE.
*/
/**
* <p>Extras {@link java.security} and {@link javax.crypto} components.</p>
* <p>Extras {@link javax.crypto} and {@link java.security} components.</p>
* @since 1.0.0
*/
package com.github.alexisjehan.javanilla.security;
package com.github.alexisjehan.javanilla.crypto;
Loading

0 comments on commit af1d7cb

Please sign in to comment.