marchof / three4j Goto Github PK
View Code? Open in Web Editor NEWThreema Gateway Client for Java
Home Page: https://github.com/marchof/three4j
License: MIT License
Threema Gateway Client for Java
Home Page: https://github.com/marchof/three4j
License: MIT License
General Description:
Gateway.Capability
is missing some values.Way to reproduce:
Gateway#getCapabilities(ThreemaId threemaid)
I receive the following exception:Exception in thread "main" java.lang.IllegalArgumentException: No enum constant com.mountainminds.three4j.Gateway.Capability.ballot
at java.base/java.lang.Enum.valueOf(Enum.java:273)
at com.mountainminds.three4j.Gateway$Capability.valueOf(Gateway.java:232)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
at com.mountainminds.three4j.Gateway.getCapabilities(Gateway.java:248)
Reason
ballot,call,videocall,image,file,text,video,audio,pfs,group,groupcall
and the enum only contains text, image, video, audio, file
.Suggestions
Capability::valueOf
some other mapping method should be used that doesn't throw an exception when trying to map to Gateway.Capability
stream(result.split(","))
.map(str -> Arrays.stream(Capability.values()).filter(cap -> cap.name().equals(str)).findFirst())
.filter(Optional::isPresent)
.map(Optional::get)
.collect(toSet());
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.