本文整理了Java中java.lang.Object.toString()
方法的一些代码示例,展示了Object.toString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Object.toString()
方法的具体详情如下:
包路径:java.lang.Object
类名称:Object
方法名:toString
暂无
代码示例来源:origin: ReactiveX/RxJava
@Override
public String toString() {
return emitter.toString();
}
}
代码示例来源:origin: iluwatar/java-design-patterns
@Override
public String toString() {
return val.toString();
}
代码示例来源:origin: ReactiveX/RxJava
@Override
public String toString() {
return String.format("TimedRunnable(time = %d, run = %s)", time, run.toString());
}
代码示例来源:origin: square/okhttp
public Builder socket(Socket socket) throws IOException {
SocketAddress remoteSocketAddress = socket.getRemoteSocketAddress();
String connectionName = remoteSocketAddress instanceof InetSocketAddress
? ((InetSocketAddress) remoteSocketAddress).getHostName()
: remoteSocketAddress.toString();
return socket(socket, connectionName,
Okio.buffer(Okio.source(socket)), Okio.buffer(Okio.sink(socket)));
}
代码示例来源:origin: ReactiveX/RxJava
@Override
public void subscribe(CompletableEmitter emitter) throws Exception {
assertTrue(emitter.toString().contains(CompletableCreate.Emitter.class.getSimpleName()));
}
}).test().assertEmpty();
代码示例来源:origin: ReactiveX/RxJava
@Override
public void subscribe(MaybeEmitter<Object> emitter) throws Exception {
assertTrue(emitter.toString().contains(MaybeCreate.Emitter.class.getSimpleName()));
}
}).test().assertEmpty();
代码示例来源:origin: ReactiveX/RxJava
@Override
public void subscribe(SingleEmitter<Object> emitter) throws Exception {
assertTrue(emitter.toString().contains(SingleCreate.Emitter.class.getSimpleName()));
}
}).test().assertEmpty();
代码示例来源:origin: ReactiveX/RxJava
@Override
public void subscribe(FlowableEmitter<Object> emitter) throws Exception {
assertTrue(emitter.toString().contains(entry.getValue().getSimpleName()));
assertTrue(emitter.serialize().toString().contains(entry.getValue().getSimpleName()));
}
}, entry.getKey()).test().assertEmpty();
代码示例来源:origin: ReactiveX/RxJava
@Override
public void subscribe(ObservableEmitter<Object> emitter) throws Exception {
assertTrue(emitter.toString().contains(ObservableCreate.CreateEmitter.class.getSimpleName()));
assertTrue(emitter.serialize().toString().contains(ObservableCreate.CreateEmitter.class.getSimpleName()));
}
}).test().assertEmpty();
代码示例来源:origin: ReactiveX/RxJava
@Test
public void validateDisposable() {
Disposable d1 = Disposables.empty();
assertFalse(EndConsumerHelper.validate(DisposableHelper.DISPOSED, d1, getClass()));
assertTrue(d1.isDisposed());
assertTrue(errors.toString(), errors.isEmpty());
}
代码示例来源:origin: ReactiveX/RxJava
@Test
public void validateSubscription() {
BooleanSubscription bs1 = new BooleanSubscription();
assertFalse(EndConsumerHelper.validate(SubscriptionHelper.CANCELLED, bs1, getClass()));
assertTrue(bs1.isCancelled());
assertTrue(errors.toString(), errors.isEmpty());
}
}
代码示例来源:origin: ReactiveX/RxJava
@Test
public void timerDelayZero() {
List<Throwable> errors = TestHelper.trackPluginErrors();
try {
for (int i = 0; i < 1000; i++) {
Flowable.timer(0, TimeUnit.MILLISECONDS).blockingFirst();
}
assertTrue(errors.toString(), errors.isEmpty());
} finally {
RxJavaPlugins.reset();
}
}
代码示例来源:origin: ReactiveX/RxJava
@Test
public void timerDelayZero() {
List<Throwable> errors = TestHelper.trackPluginErrors();
try {
for (int i = 0; i < 1000; i++) {
Observable.timer(0, TimeUnit.MILLISECONDS).blockingFirst();
}
assertTrue(errors.toString(), errors.isEmpty());
} finally {
RxJavaPlugins.reset();
}
}
代码示例来源:origin: ReactiveX/RxJava
@Test
public void errorConsumerEmpty() throws Exception {
List<Throwable> errors = TestHelper.trackPluginErrors();
try {
Functions.ERROR_CONSUMER.accept(new TestException());
TestHelper.assertUndeliverable(errors, 0, TestException.class);
assertEquals(errors.toString(), 1, errors.size());
} finally {
RxJavaPlugins.reset();
}
}
}
代码示例来源:origin: ReactiveX/RxJava
@Test
public void doOnError() {
final Object[] event = { null };
Single.error(new TestException()).doOnError(new Consumer<Throwable>() {
@Override
public void accept(Throwable e) throws Exception {
event[0] = e;
}
})
.test();
assertTrue(event[0].toString(), event[0] instanceof TestException);
}
代码示例来源:origin: ReactiveX/RxJava
@Test
public void otherSignalsAndCompletes() {
List<Throwable> errors = TestHelper.trackPluginErrors();
try {
Single.just(1).takeUntil(Flowable.just(1).take(1))
.test()
.assertFailure(CancellationException.class);
assertTrue(errors.toString(), errors.isEmpty());
} finally {
RxJavaPlugins.reset();
}
}
代码示例来源:origin: ReactiveX/RxJava
@Test
public void disposableNotification() {
Object o = NotificationLite.disposable(Disposables.empty());
assertEquals("NotificationLite.Disposable[RunnableDisposable(disposed=false, EmptyRunnable)]", o.toString());
assertFalse(NotificationLite.isError(o));
assertFalse(NotificationLite.isComplete(o));
assertTrue(NotificationLite.isDisposable(o));
assertFalse(NotificationLite.isSubscription(o));
assertNotNull(NotificationLite.getDisposable(o));
}
代码示例来源:origin: ReactiveX/RxJava
@Test
public void subscriptionNotification() {
Object o = NotificationLite.subscription(new BooleanSubscription());
assertEquals("NotificationLite.Subscription[BooleanSubscription(cancelled=false)]", o.toString());
assertFalse(NotificationLite.isError(o));
assertFalse(NotificationLite.isComplete(o));
assertFalse(NotificationLite.isDisposable(o));
assertTrue(NotificationLite.isSubscription(o));
assertNotNull(NotificationLite.getSubscription(o));
}
代码示例来源:origin: ReactiveX/RxJava
@Test
public void errorNotification() {
Object o = NotificationLite.error(new TestException());
assertEquals("NotificationLite.Error[io.reactivex.exceptions.TestException]", o.toString());
assertTrue(NotificationLite.isError(o));
assertFalse(NotificationLite.isComplete(o));
assertFalse(NotificationLite.isDisposable(o));
assertFalse(NotificationLite.isSubscription(o));
assertTrue(NotificationLite.getError(o) instanceof TestException);
}
代码示例来源:origin: ReactiveX/RxJava
@Test
public void completeNotification() {
Object o = NotificationLite.complete();
Object o2 = NotificationLite.complete();
assertSame(o, o2);
assertFalse(NotificationLite.isError(o));
assertTrue(NotificationLite.isComplete(o));
assertFalse(NotificationLite.isDisposable(o));
assertFalse(NotificationLite.isSubscription(o));
assertEquals("NotificationLite.Complete", o.toString());
assertTrue(NotificationLite.isComplete(o));
}
内容来源于网络,如有侵权,请联系作者删除!