branch develop updated (55b86ba -> be4c0c2)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository nuiton-utils. See https://gitlab.nuiton.org/nuiton/nuiton-utils.git from 55b86ba [jgitflow-maven-plugin]Updating develop poms back to pre merge state new 9b3d934 fixes #317: Update to java 8 new be4c0c2 fixes #318: Update libs The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit be4c0c2b525e111c989a7c9ed2c2fadd7860c6b5 Author: Eric Chatellier <chatellier@codelutin.com> Date: Mon Aug 21 11:44:05 2017 +0200 fixes #318: Update libs commit 9b3d93461794bf1c0f337ee4ea004f314037cf9f Author: Eric Chatellier <chatellier@codelutin.com> Date: Mon Aug 21 11:42:11 2017 +0200 fixes #317: Update to java 8 Summary of changes: .gitignore | 1 - pom.xml | 10 +++---- src/main/java/org/nuiton/util/NumberUtil.java | 31 ++++++++++++++++++++++ src/main/java/org/nuiton/util/beans/BeanUtil.java | 12 ++++++++- .../nuiton/util/pagination/PaginationResult.java | 12 ++++----- 5 files changed, 53 insertions(+), 13 deletions(-) -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository nuiton-utils. See https://gitlab.nuiton.org/nuiton/nuiton-utils.git commit 9b3d93461794bf1c0f337ee4ea004f314037cf9f Author: Eric Chatellier <chatellier@codelutin.com> Date: Mon Aug 21 11:42:11 2017 +0200 fixes #317: Update to java 8 --- pom.xml | 10 +++++----- .../java/org/nuiton/util/pagination/PaginationResult.java | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index 16ffd51..68d0552 100644 --- a/pom.xml +++ b/pom.xml @@ -132,11 +132,11 @@ <ciViewId>nuiton-utils</ciViewId> <!-- Java level --> - <javaVersion>1.6</javaVersion> - <signatureArtifactId>java16</signatureArtifactId> + <javaVersion>1.8</javaVersion> + <signatureArtifactId>java18</signatureArtifactId> <signatureVersion>1.0</signatureVersion> - <nuitonI18nVersion>3.6.2</nuitonI18nVersion> + <nuitonI18nVersion>3.6.3</nuitonI18nVersion> <!-- i18n configuration --> <i18n.bundles>fr_FR,en_GB,es_ES</i18n.bundles> @@ -160,7 +160,7 @@ <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> - <version>3.5</version> + <version>3.6</version> </dependency> <dependency> @@ -196,7 +196,7 @@ <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> - <version>19.0</version> + <version>23.0</version> </dependency> <dependency> diff --git a/src/main/java/org/nuiton/util/pagination/PaginationResult.java b/src/main/java/org/nuiton/util/pagination/PaginationResult.java index 75bf7f6..692ca9b 100644 --- a/src/main/java/org/nuiton/util/pagination/PaginationResult.java +++ b/src/main/java/org/nuiton/util/pagination/PaginationResult.java @@ -4,7 +4,7 @@ package org.nuiton.util.pagination; * #%L * Nuiton Utils * %% - * Copyright (C) 2004 - 2014 CodeLutin + * Copyright (C) 2004 - 2017 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -22,14 +22,13 @@ package org.nuiton.util.pagination; * #L% */ -import com.google.common.base.Function; import com.google.common.base.Preconditions; -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; import java.io.Serializable; import java.util.LinkedList; import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; /** * Represents the result of a pagination request. It contains the result elements together with the @@ -185,8 +184,9 @@ public class PaginationResult<O> implements Serializable { * Creates an instance of PaginationResult transforming the current one using the given function */ public <T> PaginationResult<T> transform(Function<? super O, ? extends T> function) { - Iterable<T> transformed = Iterables.transform(getElements(), function); - List<T> transformedElements = Lists.newLinkedList(transformed); + List<T> transformedElements = getElements().stream() + .map(function) + .collect(Collectors.toList()); PaginationResult<T> result = PaginationResult.of(transformedElements, getCount(), getCurrentPage()); return result; } -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository nuiton-utils. See https://gitlab.nuiton.org/nuiton/nuiton-utils.git commit be4c0c2b525e111c989a7c9ed2c2fadd7860c6b5 Author: Eric Chatellier <chatellier@codelutin.com> Date: Mon Aug 21 11:44:05 2017 +0200 fixes #318: Update libs --- .gitignore | 1 - src/main/java/org/nuiton/util/NumberUtil.java | 31 +++++++++++++++++++++++ src/main/java/org/nuiton/util/beans/BeanUtil.java | 12 ++++++++- 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 340ab47..78e7d43 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,4 @@ /*.ipr /*.iml /*.iws -/*~ /*~ \ No newline at end of file diff --git a/src/main/java/org/nuiton/util/NumberUtil.java b/src/main/java/org/nuiton/util/NumberUtil.java index 5ea7e6c..3e68cec 100644 --- a/src/main/java/org/nuiton/util/NumberUtil.java +++ b/src/main/java/org/nuiton/util/NumberUtil.java @@ -26,6 +26,7 @@ import com.google.common.base.Predicate; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import javax.annotation.Nullable; import java.math.BigDecimal; import java.math.MathContext; import java.util.Arrays; @@ -79,6 +80,11 @@ public class NumberUtil { public boolean apply(Integer input) { return input == null || input == 0; } + + @Override + public boolean test(Integer input) { + return apply(input); + } }; public static final Predicate<Float> NULL_OR_ZERO_FLOAT_ONE_DIGIT = new Predicate<Float>() { @@ -87,6 +93,11 @@ public class NumberUtil { public boolean apply(Float input) { return input == null || Math.abs(roundOneDigit(input)) < 0.1; } + + @Override + public boolean test(Float input) { + return apply(input); + } }; public static final Predicate<Float> NULL_OR_ZERO_FLOAT_TWO_DIGITS = new Predicate<Float>() { @@ -94,6 +105,11 @@ public class NumberUtil { public boolean apply(Float input) { return input == null || Math.abs(roundTwoDigits(input)) < 0.01; } + + @Override + public boolean test(Float input) { + return apply(input); + } }; public static final Predicate<Float> NULL_OR_ZERO_FLOAT_THREE_DIGITS = new Predicate<Float>() { @@ -101,6 +117,11 @@ public class NumberUtil { public boolean apply(Float input) { return input == null || Math.abs(roundThreeDigits(input)) < 0.001; } + + @Override + public boolean test(Float input) { + return apply(input); + } }; public static final Predicate<Float> NULL_OR_ZERO_FLOAT_FOUR_DIGITS = new Predicate<Float>() { @@ -108,6 +129,11 @@ public class NumberUtil { public boolean apply(Float input) { return input == null || Math.abs(roundFourDigits(input)) < 0.0001; } + + @Override + public boolean test(Float input) { + return apply(input); + } }; public static final Predicate<Float> NULL_OR_ZERO_FLOAT_FIVE_DIGITS = new Predicate<Float>() { @@ -116,6 +142,11 @@ public class NumberUtil { public boolean apply(Float input) { return input == null || Math.abs(roundFiveDigits(input)) < 0.00001; } + + @Override + public boolean test(Float input) { + return apply(input); + } }; protected static final MathContext mc1Digit = new MathContext(1); diff --git a/src/main/java/org/nuiton/util/beans/BeanUtil.java b/src/main/java/org/nuiton/util/beans/BeanUtil.java index de0f479..ec527dc 100644 --- a/src/main/java/org/nuiton/util/beans/BeanUtil.java +++ b/src/main/java/org/nuiton/util/beans/BeanUtil.java @@ -2,7 +2,7 @@ * #%L * Nuiton Utils * %% - * Copyright (C) 2004 - 2010 CodeLutin + * Copyright (C) 2004 - 2017 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -63,6 +63,11 @@ public class BeanUtil { public boolean apply(PropertyDescriptor input) { return input.getReadMethod() != null; } + + @Override + public boolean test(PropertyDescriptor input) { + return apply(input); + } }; /** @@ -75,6 +80,11 @@ public class BeanUtil { public boolean apply(PropertyDescriptor input) { return input.getWriteMethod() != null; } + + @Override + public boolean test(PropertyDescriptor input) { + return apply(input); + } }; /** -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
participants (1)
-
nuiton.org scm