String pathFile = "C:\1.txt";
Observable<String> myObservable = Observable.create(
new Observable.OnSubscribe<String>() {
@Override
public void call(Subscriber<? super String> sub) {
sub.onNext(pathFile);
sub.onCompleted();
}
});
Subscriber<String> mySubscriber = new Subscriber<String>() {
@Override
public void onNext(String s) {
// Upload file
}
@Override
public void onCompleted() { }
@Override
public void onError(Throwable e) { }
};
myObservable.subscribe(mySubscriber);
public class OrderMapper {
public static Person orderMapperPerson1(Order order) {
Person person = new Person();
person.setFirstName(order.getFirstName());
person.setLastName(order.getLastName());
person.setAge(order.getAge());
return person;
}
public static com.company.package2.Person orderMapperPerson2(Order order) {
com.company.package2.Person person = new com.company.package2.Person();
person.setFirstName(order.getFirstName());
person.setLastName(order.getLastName());
person.setAge(order.getAge());
return person;
}
}