GithubHelp home page GithubHelp logo

Comments (21)

CC007 avatar CC007 commented on July 20, 2024 17

We are now at java 15 going on 16 and Java 7 is now very much end-of-life. Isn't it time to include optionals into the standard java hamcrest library?

from javahamcrest.

davidxia avatar davidxia commented on July 20, 2024 9

Hi all. We at Spotify have open-sourced some matchers for Optionals here https://github.com/spotify/java-hamcrest. Hopefully you find these useful and maybe we can even get some of these into upstream.

Let us know if you have questions or ideas.

from javahamcrest.

npathai avatar npathai commented on July 20, 2024 7

@cod3hulk @matteprl @scheffield
I have released hamcrest-optional to maven central

<dependency>
  <groupId>com.github.npathai</groupId>
  <artifactId>hamcrest-optional</artifactId>
  <version>1.0</version>
</dependency>

from javahamcrest.

odrotbohm avatar odrotbohm commented on July 20, 2024 3

You can have support for Java 8 types but keep compatibility with former version if you just use a JDK 8 to compile the code with e.g. 1.6 target. If the code using the newly introduced types is in dedicated classes, this doesn't cause any issues. Spring Framework makes heavy use of this technique.

from javahamcrest.

devluencer-089 avatar devluencer-089 commented on July 20, 2024 2

+1

from javahamcrest.

SiliconMeeple avatar SiliconMeeple commented on July 20, 2024 1

👍

from javahamcrest.

npryce avatar npryce commented on July 20, 2024 1

Yes, but not in core, because we support old versions of the Java language that is still used in embedded systems. Matchers for Java 8 classes will have to go in their own add-on library for now.

from javahamcrest.

reardonm avatar reardonm commented on July 20, 2024 1

👍

from javahamcrest.

npathai avatar npathai commented on July 20, 2024

I have some String related utilities that I have created for my personal use. I would love to contribute those. Have we decided the way we have to package those classes? Will it be an extra library for 1.8 as well?

from javahamcrest.

npryce avatar npryce commented on July 20, 2024

I suggest publishing them as an extension library to start with.

On Wednesday, 1 July 2015, Narendra Pathai [email protected] wrote:

I have some String related utilities that I have created for my personal
use. I would love to contribute those. Have we decided the way we have to
package those classes? Will it be an extra library for 1.8 as well?


Reply to this email directly or view it on GitHub
#82 (comment)
.

from javahamcrest.

npathai avatar npathai commented on July 20, 2024

@npryce @olivergierke
I have an initial implementation at https://github.com/npathai/hamcrest-jdk8-extras
Please go through it and provide some inputs.
There are three methods: isPresent(), isEmpty() and isPresentAnd(Matcher). Out of which first two are obvious. The third one is useful for applying matchers on value inside the Optional instance.

from javahamcrest.

scheffield avatar scheffield commented on July 20, 2024

@npryce @npathai
https://github.com/npathai/hamcrest-jdk8-extras looks good, despite the double execution of the matcher in isPresentAnd(Matcher). Is there a chance to get it into hamcrest soon?

from javahamcrest.

npathai avatar npathai commented on July 20, 2024

@scheffield Great. I will get to it soon n remove double execution. I have been busy lately. I will change it this weekend.

from javahamcrest.

npathai avatar npathai commented on July 20, 2024

@scheffield I have resolved the issue. I will further refine the implementation if I get some reviews.

from javahamcrest.

npathai avatar npathai commented on July 20, 2024

Does anyone feel we need matchers for new DateTime API of Java8?

from javahamcrest.

mateusz-lisik avatar mateusz-lisik commented on July 20, 2024

@npathai I would rather see your extras merged into core project, but I think you should cover it, since you called your project "jdk8" :)

from javahamcrest.

npathai avatar npathai commented on July 20, 2024

@matteprl Yes I would like that too. But I didn't get your point.

from javahamcrest.

stefanbirkner avatar stefanbirkner commented on July 20, 2024

@npathai's hamcrest-jdk8-extras has been renamed to https://github.com/npathai/hamcrest-optional.

from javahamcrest.

mateusz-lisik avatar mateusz-lisik commented on July 20, 2024

@npathai
@stefanbirkner Thank you for information. I know that library is single file project. But have you considered putting it into maven? I like to keep my dependencies managed, and some people - just like me sometimes use search tool on sites like mvnrepository.com and just type hamcrest jdk8. I think it would also make more people use your library. :)

from javahamcrest.

npathai avatar npathai commented on July 20, 2024

@matteprl Yes we are already considering that. It will be available very soon. Thanks for your inputs.

from javahamcrest.

cod3hulk avatar cod3hulk commented on July 20, 2024

Any update about when this will make it into hamcrest project? I have seen that hamcrest-optional from @npathai was forked by @baev for maven release integration (https://github.com/baev/hamcrest-optional). But I would like to see an "official" hamcrest integration. From my point of view it makes totally sense to integrate the hamcrest-optional lib into hamcrest project.

from javahamcrest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.