com.eccyan:rxjava-optional

RxJava-Optional is an library that allows developers to use Optional using RxJava

License

License

Categories

Categories

RxJava Container Microservices Reactive libraries
GroupId

GroupId

com.eccyan
ArtifactId

ArtifactId

rxjava-optional
Last Version

Last Version

1.1.2
Release Date

Release Date

Type

Type

jar
Description

Description

com.eccyan:rxjava-optional
RxJava-Optional is an library that allows developers to use Optional using RxJava
Project URL

Project URL

https://github.com/eccyan/RxJava-Optional
Source Code Management

Source Code Management

https://github.com/eccyan/RxJava-Optional

Download rxjava-optional

How to add to project

<!-- https://jarcasting.com/artifacts/com.eccyan/rxjava-optional/ -->
<dependency>
    <groupId>com.eccyan</groupId>
    <artifactId>rxjava-optional</artifactId>
    <version>1.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.eccyan/rxjava-optional/
implementation 'com.eccyan:rxjava-optional:1.1.2'
// https://jarcasting.com/artifacts/com.eccyan/rxjava-optional/
implementation ("com.eccyan:rxjava-optional:1.1.2")
'com.eccyan:rxjava-optional:jar:1.1.2'
<dependency org="com.eccyan" name="rxjava-optional" rev="1.1.2">
  <artifact name="rxjava-optional" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.eccyan', module='rxjava-optional', version='1.1.2')
)
libraryDependencies += "com.eccyan" % "rxjava-optional" % "1.1.2"
[com.eccyan/rxjava-optional "1.1.2"]

Dependencies

runtime (1)

Group / Artifact Type Version
io.reactivex : rxjava jar 1.0.5

Project Modules

There are no modules declared in this project.

RxJava-Optional

Build Status Android Arsenal

RxJava-Optional is an library that allows developers to use Optional using RxJava

Install

Download the latest JAR or grab via Gradle:

Gradle

repositories {
    jcenter()
}

dependencies {
    compile 'io.reactivex:rxandroid:0.24.0'
    //  compile 'io.reactivex:rxjava:1.0.5'
    compile 'com.eccyan:rxjava-optional:1.1.0'
}

How to use

Optional<String> lastName = Optional.ofNullable("Daisuke");
Optional<String> firstName = Optional.ofNullable("Sato");
Optional<String> fullname =
        lastName.flatMap(new Func1<String, Optional<String>>() {
            @Override
            public Optional<String> call(final String ln) {
                return firstName.map(new Func1<String, String>() {
                    @Override
                    public String call(final String fn) {
                        return Strings.join(" ", ln, fn);
                    }
                });
            }
        });

// With retrolambda
fullName = lastName.flatMap(ln -> firstName.map(fn -> Strings.join(" ", ln, fn)));

Developed By

Daisuke Sato(eccyan) - [email protected]

Thanks

License

Copyright 2015 eccyan

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Versions

Version
1.1.2
1.1.1
1.1.0
1.0.3
1.0.2