alexengrig / lambdax Goto Github PK
View Code? Open in Web Editor NEWUseful Java 8 Lambdas
Home Page: https://lambdax.alexengrig.github.io
License: Apache License 2.0
Useful Java 8 Lambdas
Home Page: https://lambdax.alexengrig.github.io
License: Apache License 2.0
Create utility class with useful lambdas for java.lang.Deque
.
The implementation for primitives.
After doing #82.
Create JavaDoc for io.github.alexengrig.lambdax.collection.DequeX
.
Optional<T> of(T value) {
return Optional.ofNullable(value);
}
Create JavaDoc for io.github.alexengrig.lambdax.collection.SetX
.
0.1.0:
0.1.0:
Create utility class with useful lambdas for java.lang.Set
.
Create utility class with useful lambdas for java.lang.List
.
Create JavaDoc for io.github.alexengrig.lambdax.collection.MapX
.
Create PredicateX#not
like Java 11 Predicate#not
.
Create utility class with useful lambdas for java.lang.Optional
.
Writing code in chaining style.
Remove wildcards from io.github.alexengrig.lambdax.collection.*
.
public static Predicate xnor(Predicate first, Predicate second, Predicate... others)
PredicateX.of(Box::getItem).map(null); // throws the NPE
Box box = new Box(null); // without a item
PredicateX.of(Box::getItem)
.map(Item::getName) // NPE
.equal("some name");
Add PredicateX.ofNullable(...) with null handling.
Currying String.
Create package-info.java for JavaDoc.
Create JavaDoc for io.github.alexengrig.lambdax.OptionalX
.
v0.1.1
Use:
Predicate<Box> predicate = Box::isEmpty; // ok
Predicate<Box> predicate = Box::isEmpty.and(nextPredicate); // not work
Predicate<Box> predicate = PredicateX.from(Box::isEmpty).and(nextPredicate); // work
Implementation:
<T> Predicate<T> from(Predicate<? super T> checker) {
return (Predicate<T>) checker;
}
Create JavaDoc for io.github.alexengrig.lambdax.collection.CollectionX
.
Predicate<String> checker = PredicateX.and(Objects::nonNull, "Text":eqauls);
<T> Predicate<T> and(Predicate<T> first, Predicate<T> second, Predicate<T>...others) {...}
Migrate PredicateX to interface.
Create PredicateChainX.
PredicateX.chain(Box::get);
PredicateChainX.of(Box:get);
Add methods with negate predicate; name prefix "not".
Example: Collection#notContains
.
Create utility class with useful lambdas for java.lang.Map
.
Create ListX tests with use java.util.Optional
.
Use:
boxes
.stream()
// .filter(box -> box.getItem().getName() == null
.filter(PredicateX.of(Box::getItem).map(Item::getName).isNull())
// .filter(box -> box.getItem().getName() != null
.filter(PredicateX.of(Box::getItem).map(Item::getName).notNull())
Create CollectionX tests with use java.util.Optional
.
Create SetX tests with use java.util.Optional
.
Think of methods with exceptions.
Create DequeX tests with use java.util.Optional
.
Create JavaDoc for io.github.alexengrig.lambdax.collection.ListX
.
Fix MapX#get return type:
Function<Map<? extends K, ? extends V>, ? extends V>
Create QueueX tests with use java.util.Optional
.
v0.1.3
Create PredicateX#lie
for the permanent false
result: obj -> false
.
Use:
ChainX.of(HashMap<Integer, String>::new)
.mutate(MapX.onlyPut(1, "one"))
.mutate(MapX.onlyPut(2, "two"))
.get();
Create JavaDoc for io.github.alexengrig.lambdax.collection.QueueX
.
Create utility class with useful lambdas for java.lang.Collection
.
Create examples of using LambdaX library. Add some examples in README.md.
Describe the bug
Cannot resolve method 'map(java.util.function.Function<java.util.Map<? extends K,? extends V>,V>)'
Target
Method: PredicateX#map
and MapX#get
Code
class Entry {
private Map<Integer, String> numbers;
}
<...>
List<String> numbers = entries.stream()
.filter(PredicateX.of(Entry::getNumbers)
// .map(MapX.get(1)) // doesn't work
// .map(m -> m.get(1)) // doesn't work
.map((Map<Integer, String> m) -> m.get(1)) // works
.nonNull())
.collect(Collectors.toList());
v0.1.2
Create PredicateX#truth
for the permanent true
result: obj -> true
.
Create utility class with useful lambdas for java.lang.Queue
.
v0.2.0
Fix coverage.
Create static constructor of
, methods map
, check
, equal
, less
, greater
, lessOrEqual
, greaterOrEqual
.
Use:
boxes
.stream()
// NPE .filter(box -> box.getItem().getName().equals("Coca-Cola")
.filter(PredicateX.of(Box::getItem).map(Item::getName).check("Coca-Cola"::equals))
.collect(Collectors.toList());
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.