GithubHelp home page GithubHelp logo

peter-tackage / kotlin-options Goto Github PK

View Code? Open in Web Editor NEW
29.0 2.0 2.0 151 KB

Kotlin Options with functional operators

License: Apache License 2.0

Kotlin 100.00%
kotlin options optional functional rxjava2 moshi retrofit

kotlin-options's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

kotlin-options's Issues

Allow independent distribution of modules via Bintray

The distribution of the artifacts generated from the modules needs to be modified so that each module can be independent included by using a separate artifactId. After this Investigation should include how to upload bintray rather than jitpack.

Updating readme with kotlin's version of mapping

How about showing in README first how kotlin would do it's null mapping, something like this:

getCurrentUserId()
    ?.takeIf { it.isNotEmpty() && it != "Invalid Id" }
    ?.let { getCurrentUserFromDatabase(it) }
    ?.username
    ?.let { "Logged in user: $it" }
    .apply {
        if (this != null) {
            log(this)
        } else {
            log("No user to login!")
        }
    }

Of course we would need to mentione that those versions of getCurrentUserId and getCurrentUserFromDatabase return kotlin's nullable

filterIfSome vs filterNotNone

In kotlin method for filtering out nulls from a list is called filterNotNull.
Would it make sense to add filterNotNone and deprecate the filterIfSome?

Make Some constructor visible

Currently the constructor for Some is marked internal. I am now thinking that there's no benefit to not exposing it and preventing direct instantiation as:

  1. We already expose the Some and None classes, so these types are known by library clients.
  2. By ensuring the Some constructor only takes <T : Any> we prevent incorrect creation or require checkNotNull like in Java - there's no run time risk.
  3. For readability purposes, it would make defining a specific Option value clearer when using non-nulls than requiring use of optionOf. It could just be Some("abc").

Thoughts? @tomaszpolanski

Mocking framework

Hi,

hope find you well with this cold call.

I am an author of mocking framework for Kotlin

I see you are using mockito-kotlin.

I just want you to be aware that there is solution that fully supports Kotlin and ask to try it in your new/current projects.

I can help you if you answer to this issue.

Thanks and please star it

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.