rkumsher / utils Goto Github PK
View Code? Open in Web Editor NEWJava Utility Classes
License: Apache License 2.0
Java Utility Classes
License: Apache License 2.0
Similar to List.containsAll
/**
* Returns whether or not the given {@link Iterable} contains all the given elements to check for.
*
* <pre>
* IterableUtils.containsAll(Collections.emptyList(), Collections.emptyList()) = true;
* IterableUtils.containsAll(Lists.newArrayList("a"), Lists.newArrayList("a")) = true;
* IterableUtils.containsAll(Lists.newArrayList("a"), Lists.newArrayList("b")) = false;
* IterableUtils.containsAll(Lists.newArrayList("a", "b"), Lists.newArrayList("a", "b", "a", "b")) = true;
* </pre>
*
* @param iterableToCheck {@link Iterable} to to check
* @param elementsToCheckFor elements to check for
* @param <T> the type of elements in the given iterables
* @return whether or not the given {@link Iterable} contains all the given elements to check for.
*/
public static <T> boolean containsAll(Iterable<T> iterableToCheck, Iterable<T> elementsToCheckFor) {
...
}
With similar API to IterableUtils
Similar to Guava's EnumUtils. getIfPresent(Class enumClass, String value) but returns an java.util.Optional instead of com.google.common.base.Optional
Perhaps this too
DateUtils.isWithin(TemporalAccessor temporal, long amount, TemporalUnit unit)
So that the private empty constructors that do not have arguments don't negatively impact code coverage
Should also update any other outdated dependencies and plugins
With similar API to RandomCollectionUtils
With atStartOfDay and atEndOfDay. See my StackOverflow answer here
Current version of Guava () is flagged as a vulnerability. See CVE-2018-10237
Need to upgrade to at least version 24.1.1
Similar to Apache's RandomUtils but works with negative numbers
Some functionality already exists as private methods in RandomDateUtils
I attended to include this in v1.0 but couldn't decide how it should behave.
For example:
randomSetFrom(() -> "a", 3);
randomSetFrom(Sets.newHashSet("a", "b", "c"), 3);
Neither of the above could create a set with 3 elements
I suspect the behavior will have to be something like:
/**
* Returns a set filled randomly from the given elements. This will randomly put <code>
* attemptedSize</code> elements into the set, if any are equal then the returned set will contain
* less than <code>attemptedSize</code> elements.
*
* @param elements elements to randomly fill list from
* @param attemptedSize attempted size of the random set to return
* @param <T> the type of elements in the given iterable
* @return set filled randomly from the given elements
* @throws IllegalArgumentException if the elements to fill set from is empty or if the size is
* negative
*/
public static <T> Set<T> randomSetFrom(Iterable<T> elements, int attemptedSize) {
...
}
Failing since current version of jacoco doesn't support Java 11 (which Travis CI uses to build)
Since Cobertura does not support Java 8, switch to JaCoCo for code coverage
See https://github.com/codecov/example-java for example
Currently, isLeapYear is in RandomDateUtils and is package-private. Move to DateUtils and make public.
Also relax the type to accept TemporalAccessor instead of just MonthDay
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.