target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void scanNotActiveChannel() throws Exception { producerManager.registerProducer(group, clientInfo); assertThat(producerManager.getGroupChannelTable().get(group).get(channel)).isNotNull(); Field field = ProducerManager.class.getDeclaredField("CHANNEL_EXPIRED_TIMEOUT"); field.setAccessible(true); long CHANNE...
public void scanNotActiveChannel() { try { if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { for (final Map.Entry<String, HashMap<Channel, ClientChannelInfo>> entry : this.groupChannelTable .entrySet()) { final String group = entry.getKey(); final HashMap<Channel, ClientChannelInfo>...
ProducerManager { public void scanNotActiveChannel() { try { if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { for (final Map.Entry<String, HashMap<Channel, ClientChannelInfo>> entry : this.groupChannelTable .entrySet()) { final String group = entry.getKey(); final HashMap<Channel, ...
ProducerManager { public void scanNotActiveChannel() { try { if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { for (final Map.Entry<String, HashMap<Channel, ClientChannelInfo>> entry : this.groupChannelTable .entrySet()) { final String group = entry.getKey(); final HashMap<Channel, ...
ProducerManager { public void scanNotActiveChannel() { try { if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { for (final Map.Entry<String, HashMap<Channel, ClientChannelInfo>> entry : this.groupChannelTable .entrySet()) { final String group = entry.getKey(); final HashMap<Channel, ...
ProducerManager { public void scanNotActiveChannel() { try { if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { for (final Map.Entry<String, HashMap<Channel, ClientChannelInfo>> entry : this.groupChannelTable .entrySet()) { final String group = entry.getKey(); final HashMap<Channel, ...
@Test public void doChannelCloseEvent() throws Exception { producerManager.registerProducer(group, clientInfo); assertThat(producerManager.getGroupChannelTable().get(group).get(channel)).isNotNull(); producerManager.doChannelCloseEvent("127.0.0.1", channel); assertThat(producerManager.getGroupChannelTable().get(group)....
public void doChannelCloseEvent(final String remoteAddr, final Channel channel) { if (channel != null) { try { if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { for (final Map.Entry<String, HashMap<Channel, ClientChannelInfo>> entry : this.groupChannelTable .entrySet()) { final Stri...
ProducerManager { public void doChannelCloseEvent(final String remoteAddr, final Channel channel) { if (channel != null) { try { if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { for (final Map.Entry<String, HashMap<Channel, ClientChannelInfo>> entry : this.groupChannelTable .entryS...
ProducerManager { public void doChannelCloseEvent(final String remoteAddr, final Channel channel) { if (channel != null) { try { if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { for (final Map.Entry<String, HashMap<Channel, ClientChannelInfo>> entry : this.groupChannelTable .entryS...
ProducerManager { public void doChannelCloseEvent(final String remoteAddr, final Channel channel) { if (channel != null) { try { if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { for (final Map.Entry<String, HashMap<Channel, ClientChannelInfo>> entry : this.groupChannelTable .entryS...
ProducerManager { public void doChannelCloseEvent(final String remoteAddr, final Channel channel) { if (channel != null) { try { if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { for (final Map.Entry<String, HashMap<Channel, ClientChannelInfo>> entry : this.groupChannelTable .entryS...
@Test public void testRegisterProducer() throws Exception { producerManager.registerProducer(group, clientInfo); HashMap<Channel, ClientChannelInfo> channelMap = producerManager.getGroupChannelTable().get(group); assertThat(channelMap).isNotNull(); assertThat(channelMap.get(channel)).isEqualTo(clientInfo); }
public void registerProducer(final String group, final ClientChannelInfo clientChannelInfo) { try { ClientChannelInfo clientChannelInfoFound = null; if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { HashMap<Channel, ClientChannelInfo> channelTable = this.groupChannelTable.get(group)...
ProducerManager { public void registerProducer(final String group, final ClientChannelInfo clientChannelInfo) { try { ClientChannelInfo clientChannelInfoFound = null; if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { HashMap<Channel, ClientChannelInfo> channelTable = this.groupChann...
ProducerManager { public void registerProducer(final String group, final ClientChannelInfo clientChannelInfo) { try { ClientChannelInfo clientChannelInfoFound = null; if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { HashMap<Channel, ClientChannelInfo> channelTable = this.groupChann...
ProducerManager { public void registerProducer(final String group, final ClientChannelInfo clientChannelInfo) { try { ClientChannelInfo clientChannelInfoFound = null; if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { HashMap<Channel, ClientChannelInfo> channelTable = this.groupChann...
ProducerManager { public void registerProducer(final String group, final ClientChannelInfo clientChannelInfo) { try { ClientChannelInfo clientChannelInfoFound = null; if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { HashMap<Channel, ClientChannelInfo> channelTable = this.groupChann...
@Test public void unregisterProducer() throws Exception { producerManager.registerProducer(group, clientInfo); HashMap<Channel, ClientChannelInfo> channelMap = producerManager.getGroupChannelTable().get(group); assertThat(channelMap).isNotNull(); assertThat(channelMap.get(channel)).isEqualTo(clientInfo); producerManage...
public void unregisterProducer(final String group, final ClientChannelInfo clientChannelInfo) { try { if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { HashMap<Channel, ClientChannelInfo> channelTable = this.groupChannelTable.get(group); if (null != channelTable && !channelTable.isE...
ProducerManager { public void unregisterProducer(final String group, final ClientChannelInfo clientChannelInfo) { try { if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { HashMap<Channel, ClientChannelInfo> channelTable = this.groupChannelTable.get(group); if (null != channelTable &&...
ProducerManager { public void unregisterProducer(final String group, final ClientChannelInfo clientChannelInfo) { try { if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { HashMap<Channel, ClientChannelInfo> channelTable = this.groupChannelTable.get(group); if (null != channelTable &&...
ProducerManager { public void unregisterProducer(final String group, final ClientChannelInfo clientChannelInfo) { try { if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { HashMap<Channel, ClientChannelInfo> channelTable = this.groupChannelTable.get(group); if (null != channelTable &&...
ProducerManager { public void unregisterProducer(final String group, final ClientChannelInfo clientChannelInfo) { try { if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { HashMap<Channel, ClientChannelInfo> channelTable = this.groupChannelTable.get(group); if (null != channelTable &&...
@Test public void testProcessRequest() throws RemotingCommandException { when(messageStore.putMessage(any(MessageExtBrokerInner.class))).thenReturn(new PutMessageResult(PutMessageStatus.PUT_OK, new AppendMessageResult(AppendMessageStatus.PUT_OK))); assertPutResult(ResponseCode.SUCCESS); }
@Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { SendMessageContext mqtraceContext; switch (request.getCode()) { case RequestCode.CONSUMER_SEND_MSG_BACK: return this.consumerSendMsgBack(ctx, request); default: SendMessageRequestHeader ...
SendMessageProcessor extends AbstractSendMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { SendMessageContext mqtraceContext; switch (request.getCode()) { case RequestCode.CONSUMER_SEN...
SendMessageProcessor extends AbstractSendMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { SendMessageContext mqtraceContext; switch (request.getCode()) { case RequestCode.CONSUMER_SEN...
SendMessageProcessor extends AbstractSendMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { SendMessageContext mqtraceContext; switch (request.getCode()) { case RequestCode.CONSUMER_SEN...
SendMessageProcessor extends AbstractSendMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { SendMessageContext mqtraceContext; switch (request.getCode()) { case RequestCode.CONSUMER_SEN...
@Test public void testProcessRequest_WithMsgBack() throws RemotingCommandException { when(messageStore.putMessage(any(MessageExtBrokerInner.class))).thenReturn(new PutMessageResult(PutMessageStatus.PUT_OK, new AppendMessageResult(AppendMessageStatus.PUT_OK))); final RemotingCommand request = createSendMsgBackCommand(Re...
@Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { SendMessageContext mqtraceContext; switch (request.getCode()) { case RequestCode.CONSUMER_SEND_MSG_BACK: return this.consumerSendMsgBack(ctx, request); default: SendMessageRequestHeader ...
SendMessageProcessor extends AbstractSendMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { SendMessageContext mqtraceContext; switch (request.getCode()) { case RequestCode.CONSUMER_SEN...
SendMessageProcessor extends AbstractSendMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { SendMessageContext mqtraceContext; switch (request.getCode()) { case RequestCode.CONSUMER_SEN...
SendMessageProcessor extends AbstractSendMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { SendMessageContext mqtraceContext; switch (request.getCode()) { case RequestCode.CONSUMER_SEN...
SendMessageProcessor extends AbstractSendMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { SendMessageContext mqtraceContext; switch (request.getCode()) { case RequestCode.CONSUMER_SEN...
@Test public void processRequest_UnRegisterProducer() throws Exception { brokerController.getProducerManager().registerProducer(group, clientChannelInfo); HashMap<Channel, ClientChannelInfo> channelMap = brokerController.getProducerManager().getGroupChannelTable().get(group); assertThat(channelMap).isNotNull(); assertT...
@Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { switch (request.getCode()) { case RequestCode.HEART_BEAT: return this.heartBeat(ctx, request); case RequestCode.UNREGISTER_CLIENT: return this.unregisterClient(ctx, request); case Reques...
ClientManageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { switch (request.getCode()) { case RequestCode.HEART_BEAT: return this.heartBeat(ctx, request); case RequestCode.UNREGISTER_CLIENT...
ClientManageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { switch (request.getCode()) { case RequestCode.HEART_BEAT: return this.heartBeat(ctx, request); case RequestCode.UNREGISTER_CLIENT...
ClientManageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { switch (request.getCode()) { case RequestCode.HEART_BEAT: return this.heartBeat(ctx, request); case RequestCode.UNREGISTER_CLIENT...
ClientManageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { switch (request.getCode()) { case RequestCode.HEART_BEAT: return this.heartBeat(ctx, request); case RequestCode.UNREGISTER_CLIENT...
@Test public void processRequest_UnRegisterConsumer() throws RemotingCommandException { ConsumerGroupInfo consumerGroupInfo = brokerController.getConsumerManager().getConsumerGroupInfo(group); assertThat(consumerGroupInfo).isNotNull(); RemotingCommand request = createUnRegisterConsumerCommand(); RemotingCommand respons...
@Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { switch (request.getCode()) { case RequestCode.HEART_BEAT: return this.heartBeat(ctx, request); case RequestCode.UNREGISTER_CLIENT: return this.unregisterClient(ctx, request); case Reques...
ClientManageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { switch (request.getCode()) { case RequestCode.HEART_BEAT: return this.heartBeat(ctx, request); case RequestCode.UNREGISTER_CLIENT...
ClientManageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { switch (request.getCode()) { case RequestCode.HEART_BEAT: return this.heartBeat(ctx, request); case RequestCode.UNREGISTER_CLIENT...
ClientManageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { switch (request.getCode()) { case RequestCode.HEART_BEAT: return this.heartBeat(ctx, request); case RequestCode.UNREGISTER_CLIENT...
ClientManageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { switch (request.getCode()) { case RequestCode.HEART_BEAT: return this.heartBeat(ctx, request); case RequestCode.UNREGISTER_CLIENT...
@Test public void testProcessRequest_TopicNotExist() throws RemotingCommandException { brokerController.getTopicConfigManager().getTopicConfigTable().remove(topic); final RemotingCommand request = createPullMsgCommand(RequestCode.PULL_MESSAGE); RemotingCommand response = pullMessageProcessor.processRequest(handlerConte...
@Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); }
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } }
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } PullMessageProcessor(final BrokerController brokerController); }
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } PullMessageProcessor(final BrokerController brokerController); @...
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } PullMessageProcessor(final BrokerController brokerController); @...
@Test public void testProcessRequest_SubNotExist() throws RemotingCommandException { brokerController.getConsumerManager().unregisterConsumer(group, clientChannelInfo, false); final RemotingCommand request = createPullMsgCommand(RequestCode.PULL_MESSAGE); RemotingCommand response = pullMessageProcessor.processRequest(h...
@Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); }
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } }
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } PullMessageProcessor(final BrokerController brokerController); }
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } PullMessageProcessor(final BrokerController brokerController); @...
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } PullMessageProcessor(final BrokerController brokerController); @...
@Test public void testProcessRequest_SubNotLatest() throws RemotingCommandException { final RemotingCommand request = createPullMsgCommand(RequestCode.PULL_MESSAGE); request.addExtField("subVersion", String.valueOf(101)); RemotingCommand response = pullMessageProcessor.processRequest(handlerContext, request); assertTha...
@Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); }
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } }
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } PullMessageProcessor(final BrokerController brokerController); }
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } PullMessageProcessor(final BrokerController brokerController); @...
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } PullMessageProcessor(final BrokerController brokerController); @...
@Test public void testProcessRequest_Found() throws RemotingCommandException { GetMessageResult getMessageResult = createGetMessageResult(); when(messageStore.getMessage(anyString(), anyString(), anyInt(), anyLong(), anyInt(), any(ExpressionMessageFilter.class))).thenReturn(getMessageResult); final RemotingCommand requ...
@Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); }
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } }
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } PullMessageProcessor(final BrokerController brokerController); }
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } PullMessageProcessor(final BrokerController brokerController); @...
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } PullMessageProcessor(final BrokerController brokerController); @...
@Test public void testProcessRequest_MsgWasRemoving() throws RemotingCommandException { GetMessageResult getMessageResult = createGetMessageResult(); getMessageResult.setStatus(GetMessageStatus.MESSAGE_WAS_REMOVING); when(messageStore.getMessage(anyString(), anyString(), anyInt(), anyLong(), anyInt(), any(ExpressionMes...
@Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); }
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } }
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } PullMessageProcessor(final BrokerController brokerController); }
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } PullMessageProcessor(final BrokerController brokerController); @...
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } PullMessageProcessor(final BrokerController brokerController); @...
@Test public void testProcessRequest_NoMsgInQueue() throws RemotingCommandException { GetMessageResult getMessageResult = createGetMessageResult(); getMessageResult.setStatus(GetMessageStatus.NO_MESSAGE_IN_QUEUE); when(messageStore.getMessage(anyString(), anyString(), anyInt(), anyLong(), anyInt(), any(ExpressionMessag...
@Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); }
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } }
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } PullMessageProcessor(final BrokerController brokerController); }
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } PullMessageProcessor(final BrokerController brokerController); @...
PullMessageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(final ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { return this.processRequest(ctx.channel(), request, true); } PullMessageProcessor(final BrokerController brokerController); @...
@Test public void testProperties2SystemEnv() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { Properties properties = new Properties(); Class<BrokerStartup> clazz = BrokerStartup.class; Method method = clazz.getDeclaredMethod("properties2SystemEnv", Properties.class); method.setAccessib...
private static void properties2SystemEnv(Properties properties) { if (properties == null) { return; } String rmqAddressServerDomain = properties.getProperty("rmqAddressServerDomain", MixAll.WS_DOMAIN_NAME); String rmqAddressServerSubGroup = properties.getProperty("rmqAddressServerSubGroup", MixAll.WS_DOMAIN_SUBGROUP); ...
BrokerStartup { private static void properties2SystemEnv(Properties properties) { if (properties == null) { return; } String rmqAddressServerDomain = properties.getProperty("rmqAddressServerDomain", MixAll.WS_DOMAIN_NAME); String rmqAddressServerSubGroup = properties.getProperty("rmqAddressServerSubGroup", MixAll.WS_DO...
BrokerStartup { private static void properties2SystemEnv(Properties properties) { if (properties == null) { return; } String rmqAddressServerDomain = properties.getProperty("rmqAddressServerDomain", MixAll.WS_DOMAIN_NAME); String rmqAddressServerSubGroup = properties.getProperty("rmqAddressServerSubGroup", MixAll.WS_DO...
BrokerStartup { private static void properties2SystemEnv(Properties properties) { if (properties == null) { return; } String rmqAddressServerDomain = properties.getProperty("rmqAddressServerDomain", MixAll.WS_DOMAIN_NAME); String rmqAddressServerSubGroup = properties.getProperty("rmqAddressServerSubGroup", MixAll.WS_DO...
BrokerStartup { private static void properties2SystemEnv(Properties properties) { if (properties == null) { return; } String rmqAddressServerDomain = properties.getProperty("rmqAddressServerDomain", MixAll.WS_DOMAIN_NAME); String rmqAddressServerSubGroup = properties.getProperty("rmqAddressServerSubGroup", MixAll.WS_DO...
@Test public void testSelectMappedBuffer() throws IOException { MappedFile mappedFile = new MappedFile("target/unit_test_store/MappedFileTest/000", 1024 * 64); boolean result = mappedFile.appendMessage(storeMessage.getBytes()); assertThat(result).isTrue(); SelectMappedBufferResult selectMappedBufferResult = mappedFile....
public SelectMappedBufferResult selectMappedBuffer(int pos, int size) { int readPosition = getReadPosition(); if ((pos + size) <= readPosition) { if (this.hold()) { ByteBuffer byteBuffer = this.mappedByteBuffer.slice(); byteBuffer.position(pos); ByteBuffer byteBufferNew = byteBuffer.slice(); byteBufferNew.limit(size); ...
MappedFile extends ReferenceResource { public SelectMappedBufferResult selectMappedBuffer(int pos, int size) { int readPosition = getReadPosition(); if ((pos + size) <= readPosition) { if (this.hold()) { ByteBuffer byteBuffer = this.mappedByteBuffer.slice(); byteBuffer.position(pos); ByteBuffer byteBufferNew = byteBuff...
MappedFile extends ReferenceResource { public SelectMappedBufferResult selectMappedBuffer(int pos, int size) { int readPosition = getReadPosition(); if ((pos + size) <= readPosition) { if (this.hold()) { ByteBuffer byteBuffer = this.mappedByteBuffer.slice(); byteBuffer.position(pos); ByteBuffer byteBufferNew = byteBuff...
MappedFile extends ReferenceResource { public SelectMappedBufferResult selectMappedBuffer(int pos, int size) { int readPosition = getReadPosition(); if ((pos + size) <= readPosition) { if (this.hold()) { ByteBuffer byteBuffer = this.mappedByteBuffer.slice(); byteBuffer.position(pos); ByteBuffer byteBufferNew = byteBuff...
MappedFile extends ReferenceResource { public SelectMappedBufferResult selectMappedBuffer(int pos, int size) { int readPosition = getReadPosition(); if ((pos + size) <= readPosition) { if (this.hold()) { ByteBuffer byteBuffer = this.mappedByteBuffer.slice(); byteBuffer.position(pos); ByteBuffer byteBufferNew = byteBuff...
@Test public void testPut() { ConsumeQueueExt consumeQueueExt = genExt(); try { putSth(consumeQueueExt, true, false, unitCount); } finally { consumeQueueExt.destroy(); deleteDirectory(storePath); } }
public long put(final CqExtUnit cqExtUnit) { final int retryTimes = 3; try { int size = cqExtUnit.calcUnitSize(); if (size > CqExtUnit.MAX_EXT_UNIT_SIZE) { log.error("Size of cq ext unit is greater than {}, {}", CqExtUnit.MAX_EXT_UNIT_SIZE, cqExtUnit); return 1; } if (this.mappedFileQueue.getMaxOffset() + size > MAX_RE...
ConsumeQueueExt { public long put(final CqExtUnit cqExtUnit) { final int retryTimes = 3; try { int size = cqExtUnit.calcUnitSize(); if (size > CqExtUnit.MAX_EXT_UNIT_SIZE) { log.error("Size of cq ext unit is greater than {}, {}", CqExtUnit.MAX_EXT_UNIT_SIZE, cqExtUnit); return 1; } if (this.mappedFileQueue.getMaxOffset...
ConsumeQueueExt { public long put(final CqExtUnit cqExtUnit) { final int retryTimes = 3; try { int size = cqExtUnit.calcUnitSize(); if (size > CqExtUnit.MAX_EXT_UNIT_SIZE) { log.error("Size of cq ext unit is greater than {}, {}", CqExtUnit.MAX_EXT_UNIT_SIZE, cqExtUnit); return 1; } if (this.mappedFileQueue.getMaxOffset...
ConsumeQueueExt { public long put(final CqExtUnit cqExtUnit) { final int retryTimes = 3; try { int size = cqExtUnit.calcUnitSize(); if (size > CqExtUnit.MAX_EXT_UNIT_SIZE) { log.error("Size of cq ext unit is greater than {}, {}", CqExtUnit.MAX_EXT_UNIT_SIZE, cqExtUnit); return 1; } if (this.mappedFileQueue.getMaxOffset...
ConsumeQueueExt { public long put(final CqExtUnit cqExtUnit) { final int retryTimes = 3; try { int size = cqExtUnit.calcUnitSize(); if (size > CqExtUnit.MAX_EXT_UNIT_SIZE) { log.error("Size of cq ext unit is greater than {}, {}", CqExtUnit.MAX_EXT_UNIT_SIZE, cqExtUnit); return 1; } if (this.mappedFileQueue.getMaxOffset...
@Test public void testGet() { ConsumeQueueExt consumeQueueExt = genExt(); putSth(consumeQueueExt, false, false, unitCount); try { long addr = consumeQueueExt.decorate(0); ConsumeQueueExt.CqExtUnit unit = new ConsumeQueueExt.CqExtUnit(); while (true) { boolean ret = consumeQueueExt.get(addr, unit); if (!ret) { break; } ...
public CqExtUnit get(final long address) { CqExtUnit cqExtUnit = new CqExtUnit(); if (get(address, cqExtUnit)) { return cqExtUnit; } return null; }
ConsumeQueueExt { public CqExtUnit get(final long address) { CqExtUnit cqExtUnit = new CqExtUnit(); if (get(address, cqExtUnit)) { return cqExtUnit; } return null; } }
ConsumeQueueExt { public CqExtUnit get(final long address) { CqExtUnit cqExtUnit = new CqExtUnit(); if (get(address, cqExtUnit)) { return cqExtUnit; } return null; } ConsumeQueueExt(final String topic, final int queueId, final String storePath, ...
ConsumeQueueExt { public CqExtUnit get(final long address) { CqExtUnit cqExtUnit = new CqExtUnit(); if (get(address, cqExtUnit)) { return cqExtUnit; } return null; } ConsumeQueueExt(final String topic, final int queueId, final String storePath, ...
ConsumeQueueExt { public CqExtUnit get(final long address) { CqExtUnit cqExtUnit = new CqExtUnit(); if (get(address, cqExtUnit)) { return cqExtUnit; } return null; } ConsumeQueueExt(final String topic, final int queueId, final String storePath, ...
@Test public void testPutKey() throws Exception { IndexFile indexFile = new IndexFile("100", HASH_SLOT_NUM, INDEX_NUM, 0, 0); for (long i = 0; i < (INDEX_NUM - 1); i++) { boolean putResult = indexFile.putKey(Long.toString(i), i, System.currentTimeMillis()); assertThat(putResult).isTrue(); } boolean putResult = indexFil...
public boolean putKey(final String key, final long phyOffset, final long storeTimestamp) { if (this.indexHeader.getIndexCount() < this.indexNum) { int keyHash = indexKeyHashMethod(key); int slotPos = keyHash % this.hashSlotNum; int absSlotPos = IndexHeader.INDEX_HEADER_SIZE + slotPos * hashSlotSize; FileLock fileLock =...
IndexFile { public boolean putKey(final String key, final long phyOffset, final long storeTimestamp) { if (this.indexHeader.getIndexCount() < this.indexNum) { int keyHash = indexKeyHashMethod(key); int slotPos = keyHash % this.hashSlotNum; int absSlotPos = IndexHeader.INDEX_HEADER_SIZE + slotPos * hashSlotSize; FileLoc...
IndexFile { public boolean putKey(final String key, final long phyOffset, final long storeTimestamp) { if (this.indexHeader.getIndexCount() < this.indexNum) { int keyHash = indexKeyHashMethod(key); int slotPos = keyHash % this.hashSlotNum; int absSlotPos = IndexHeader.INDEX_HEADER_SIZE + slotPos * hashSlotSize; FileLoc...
IndexFile { public boolean putKey(final String key, final long phyOffset, final long storeTimestamp) { if (this.indexHeader.getIndexCount() < this.indexNum) { int keyHash = indexKeyHashMethod(key); int slotPos = keyHash % this.hashSlotNum; int absSlotPos = IndexHeader.INDEX_HEADER_SIZE + slotPos * hashSlotSize; FileLoc...
IndexFile { public boolean putKey(final String key, final long phyOffset, final long storeTimestamp) { if (this.indexHeader.getIndexCount() < this.indexNum) { int keyHash = indexKeyHashMethod(key); int slotPos = keyHash % this.hashSlotNum; int absSlotPos = IndexHeader.INDEX_HEADER_SIZE + slotPos * hashSlotSize; FileLoc...
@Test public void testSelectPhyOffset() throws Exception { IndexFile indexFile = new IndexFile("200", HASH_SLOT_NUM, INDEX_NUM, 0, 0); for (long i = 0; i < (INDEX_NUM - 1); i++) { boolean putResult = indexFile.putKey(Long.toString(i), i, System.currentTimeMillis()); assertThat(putResult).isTrue(); } boolean putResult =...
public void selectPhyOffset(final List<Long> phyOffsets, final String key, final int maxNum, final long begin, final long end, boolean lock) { if (this.mappedFile.hold()) { int keyHash = indexKeyHashMethod(key); int slotPos = keyHash % this.hashSlotNum; int absSlotPos = IndexHeader.INDEX_HEADER_SIZE + slotPos * hashSlo...
IndexFile { public void selectPhyOffset(final List<Long> phyOffsets, final String key, final int maxNum, final long begin, final long end, boolean lock) { if (this.mappedFile.hold()) { int keyHash = indexKeyHashMethod(key); int slotPos = keyHash % this.hashSlotNum; int absSlotPos = IndexHeader.INDEX_HEADER_SIZE + slotP...
IndexFile { public void selectPhyOffset(final List<Long> phyOffsets, final String key, final int maxNum, final long begin, final long end, boolean lock) { if (this.mappedFile.hold()) { int keyHash = indexKeyHashMethod(key); int slotPos = keyHash % this.hashSlotNum; int absSlotPos = IndexHeader.INDEX_HEADER_SIZE + slotP...
IndexFile { public void selectPhyOffset(final List<Long> phyOffsets, final String key, final int maxNum, final long begin, final long end, boolean lock) { if (this.mappedFile.hold()) { int keyHash = indexKeyHashMethod(key); int slotPos = keyHash % this.hashSlotNum; int absSlotPos = IndexHeader.INDEX_HEADER_SIZE + slotP...
IndexFile { public void selectPhyOffset(final List<Long> phyOffsets, final String key, final int maxNum, final long begin, final long end, boolean lock) { if (this.mappedFile.hold()) { int keyHash = indexKeyHashMethod(key); int slotPos = keyHash % this.hashSlotNum; int absSlotPos = IndexHeader.INDEX_HEADER_SIZE + slotP...
@Test public void testConsumerFallBehindThresholdOverflow() { long expect = 1024L * 1024 * 1024 * 16; assertThat(new BrokerConfig().getConsumerFallbehindThreshold()).isEqualTo(expect); }
public long getConsumerFallbehindThreshold() { return consumerFallbehindThreshold; }
BrokerConfig { public long getConsumerFallbehindThreshold() { return consumerFallbehindThreshold; } }
BrokerConfig { public long getConsumerFallbehindThreshold() { return consumerFallbehindThreshold; } }
BrokerConfig { public long getConsumerFallbehindThreshold() { return consumerFallbehindThreshold; } static String localHostName(); boolean isTraceOn(); void setTraceOn(final boolean traceOn); long getStartAcceptSendRequestTimeStamp(); void setStartAcceptSendRequestTimeStamp(final long startAcceptSendRequestTimeStamp);...
BrokerConfig { public long getConsumerFallbehindThreshold() { return consumerFallbehindThreshold; } static String localHostName(); boolean isTraceOn(); void setTraceOn(final boolean traceOn); long getStartAcceptSendRequestTimeStamp(); void setStartAcceptSendRequestTimeStamp(final long startAcceptSendRequestTimeStamp);...
@Test public void testDecodeProperties() { MessageExt messageExt = new MessageExt(); messageExt.setMsgId("645100FA00002A9F000000489A3AA09E"); messageExt.setTopic("abc"); messageExt.setBody("hello!q!".getBytes()); try { messageExt.setBornHost(new InetSocketAddress(InetAddress.getByName("127.0.0.1"), 0)); } catch (Unknow...
public static Map<String, String> decodeProperties(java.nio.ByteBuffer byteBuffer) { int topicLengthPosition = BODY_SIZE_POSITION + 4 + byteBuffer.getInt(BODY_SIZE_POSITION); byte topicLength = byteBuffer.get(topicLengthPosition); short propertiesLength = byteBuffer.getShort(topicLengthPosition + 1 + topicLength); byte...
MessageDecoder { public static Map<String, String> decodeProperties(java.nio.ByteBuffer byteBuffer) { int topicLengthPosition = BODY_SIZE_POSITION + 4 + byteBuffer.getInt(BODY_SIZE_POSITION); byte topicLength = byteBuffer.get(topicLengthPosition); short propertiesLength = byteBuffer.getShort(topicLengthPosition + 1 + t...
MessageDecoder { public static Map<String, String> decodeProperties(java.nio.ByteBuffer byteBuffer) { int topicLengthPosition = BODY_SIZE_POSITION + 4 + byteBuffer.getInt(BODY_SIZE_POSITION); byte topicLength = byteBuffer.get(topicLengthPosition); short propertiesLength = byteBuffer.getShort(topicLengthPosition + 1 + t...
MessageDecoder { public static Map<String, String> decodeProperties(java.nio.ByteBuffer byteBuffer) { int topicLengthPosition = BODY_SIZE_POSITION + 4 + byteBuffer.getInt(BODY_SIZE_POSITION); byte topicLength = byteBuffer.get(topicLengthPosition); short propertiesLength = byteBuffer.getShort(topicLengthPosition + 1 + t...
MessageDecoder { public static Map<String, String> decodeProperties(java.nio.ByteBuffer byteBuffer) { int topicLengthPosition = BODY_SIZE_POSITION + 4 + byteBuffer.getInt(BODY_SIZE_POSITION); byte topicLength = byteBuffer.get(topicLengthPosition); short propertiesLength = byteBuffer.getShort(topicLengthPosition + 1 + t...
@Test public void testBuildSubscriptionData() throws Exception { SubscriptionData subscriptionData = FilterAPI.buildSubscriptionData(group, topic, subString); assertThat(subscriptionData.getTopic()).isEqualTo(topic); assertThat(subscriptionData.getSubString()).isEqualTo(subString); String [] tags = subString.split("\\|...
public static SubscriptionData buildSubscriptionData(final String consumerGroup, String topic, String subString) throws Exception { SubscriptionData subscriptionData = new SubscriptionData(); subscriptionData.setTopic(topic); subscriptionData.setSubString(subString); if (null == subString || subString.equals(Subscripti...
FilterAPI { public static SubscriptionData buildSubscriptionData(final String consumerGroup, String topic, String subString) throws Exception { SubscriptionData subscriptionData = new SubscriptionData(); subscriptionData.setTopic(topic); subscriptionData.setSubString(subString); if (null == subString || subString.equal...
FilterAPI { public static SubscriptionData buildSubscriptionData(final String consumerGroup, String topic, String subString) throws Exception { SubscriptionData subscriptionData = new SubscriptionData(); subscriptionData.setTopic(topic); subscriptionData.setSubString(subString); if (null == subString || subString.equal...
FilterAPI { public static SubscriptionData buildSubscriptionData(final String consumerGroup, String topic, String subString) throws Exception { SubscriptionData subscriptionData = new SubscriptionData(); subscriptionData.setTopic(topic); subscriptionData.setSubString(subString); if (null == subString || subString.equal...
FilterAPI { public static SubscriptionData buildSubscriptionData(final String consumerGroup, String topic, String subString) throws Exception { SubscriptionData subscriptionData = new SubscriptionData(); subscriptionData.setTopic(topic); subscriptionData.setSubString(subString); if (null == subString || subString.equal...
@Test public void testBuildTagSome() { try { SubscriptionData subscriptionData = FilterAPI.build( "TOPIC", "A || B", ExpressionType.TAG ); assertThat(subscriptionData).isNotNull(); assertThat(subscriptionData.getTopic()).isEqualTo("TOPIC"); assertThat(subscriptionData.getSubString()).isEqualTo("A || B"); assertThat(Exp...
public static SubscriptionData build(final String topic, final String subString, final String type) throws Exception { if (ExpressionType.TAG.equals(type) || type == null) { return buildSubscriptionData(null, topic, subString); } if (subString == null || subString.length() < 1) { throw new IllegalArgumentException("Exp...
FilterAPI { public static SubscriptionData build(final String topic, final String subString, final String type) throws Exception { if (ExpressionType.TAG.equals(type) || type == null) { return buildSubscriptionData(null, topic, subString); } if (subString == null || subString.length() < 1) { throw new IllegalArgumentEx...
FilterAPI { public static SubscriptionData build(final String topic, final String subString, final String type) throws Exception { if (ExpressionType.TAG.equals(type) || type == null) { return buildSubscriptionData(null, topic, subString); } if (subString == null || subString.length() < 1) { throw new IllegalArgumentEx...
FilterAPI { public static SubscriptionData build(final String topic, final String subString, final String type) throws Exception { if (ExpressionType.TAG.equals(type) || type == null) { return buildSubscriptionData(null, topic, subString); } if (subString == null || subString.length() < 1) { throw new IllegalArgumentEx...
FilterAPI { public static SubscriptionData build(final String topic, final String subString, final String type) throws Exception { if (ExpressionType.TAG.equals(type) || type == null) { return buildSubscriptionData(null, topic, subString); } if (subString == null || subString.length() < 1) { throw new IllegalArgumentEx...
@Test public void testBuildSQL() { try { SubscriptionData subscriptionData = FilterAPI.build( "TOPIC", "a is not null", ExpressionType.SQL92 ); assertThat(subscriptionData).isNotNull(); assertThat(subscriptionData.getTopic()).isEqualTo("TOPIC"); assertThat(subscriptionData.getExpressionType()).isEqualTo(ExpressionType....
public static SubscriptionData build(final String topic, final String subString, final String type) throws Exception { if (ExpressionType.TAG.equals(type) || type == null) { return buildSubscriptionData(null, topic, subString); } if (subString == null || subString.length() < 1) { throw new IllegalArgumentException("Exp...
FilterAPI { public static SubscriptionData build(final String topic, final String subString, final String type) throws Exception { if (ExpressionType.TAG.equals(type) || type == null) { return buildSubscriptionData(null, topic, subString); } if (subString == null || subString.length() < 1) { throw new IllegalArgumentEx...
FilterAPI { public static SubscriptionData build(final String topic, final String subString, final String type) throws Exception { if (ExpressionType.TAG.equals(type) || type == null) { return buildSubscriptionData(null, topic, subString); } if (subString == null || subString.length() < 1) { throw new IllegalArgumentEx...
FilterAPI { public static SubscriptionData build(final String topic, final String subString, final String type) throws Exception { if (ExpressionType.TAG.equals(type) || type == null) { return buildSubscriptionData(null, topic, subString); } if (subString == null || subString.length() < 1) { throw new IllegalArgumentEx...
FilterAPI { public static SubscriptionData build(final String topic, final String subString, final String type) throws Exception { if (ExpressionType.TAG.equals(type) || type == null) { return buildSubscriptionData(null, topic, subString); } if (subString == null || subString.length() < 1) { throw new IllegalArgumentEx...
@Test public void testBuildSQLWithNullSubString() { try { FilterAPI.build( "TOPIC", null, ExpressionType.SQL92 ); assertThat(Boolean.FALSE).isTrue(); } catch (Exception e) { e.printStackTrace(); } }
public static SubscriptionData build(final String topic, final String subString, final String type) throws Exception { if (ExpressionType.TAG.equals(type) || type == null) { return buildSubscriptionData(null, topic, subString); } if (subString == null || subString.length() < 1) { throw new IllegalArgumentException("Exp...
FilterAPI { public static SubscriptionData build(final String topic, final String subString, final String type) throws Exception { if (ExpressionType.TAG.equals(type) || type == null) { return buildSubscriptionData(null, topic, subString); } if (subString == null || subString.length() < 1) { throw new IllegalArgumentEx...
FilterAPI { public static SubscriptionData build(final String topic, final String subString, final String type) throws Exception { if (ExpressionType.TAG.equals(type) || type == null) { return buildSubscriptionData(null, topic, subString); } if (subString == null || subString.length() < 1) { throw new IllegalArgumentEx...
FilterAPI { public static SubscriptionData build(final String topic, final String subString, final String type) throws Exception { if (ExpressionType.TAG.equals(type) || type == null) { return buildSubscriptionData(null, topic, subString); } if (subString == null || subString.length() < 1) { throw new IllegalArgumentEx...
FilterAPI { public static SubscriptionData build(final String topic, final String subString, final String type) throws Exception { if (ExpressionType.TAG.equals(type) || type == null) { return buildSubscriptionData(null, topic, subString); } if (subString == null || subString.length() < 1) { throw new IllegalArgumentEx...
@Test public void testEquals() { DataVersion dataVersion = new DataVersion(); DataVersion other = new DataVersion(); other.setTimestamp(dataVersion.getTimestamp()); Assert.assertTrue(dataVersion.equals(other)); }
@Override public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final DataVersion that = (DataVersion) o; if (timestamp != that.timestamp) { return false; } if (counter != null && that.counter != null) { return counter.longValue() == that.counter....
DataVersion extends RemotingSerializable { @Override public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final DataVersion that = (DataVersion) o; if (timestamp != that.timestamp) { return false; } if (counter != null && that.counter != null) { ...
DataVersion extends RemotingSerializable { @Override public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final DataVersion that = (DataVersion) o; if (timestamp != that.timestamp) { return false; } if (counter != null && that.counter != null) { ...
DataVersion extends RemotingSerializable { @Override public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final DataVersion that = (DataVersion) o; if (timestamp != that.timestamp) { return false; } if (counter != null && that.counter != null) { ...
DataVersion extends RemotingSerializable { @Override public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final DataVersion that = (DataVersion) o; if (timestamp != that.timestamp) { return false; } if (counter != null && that.counter != null) { ...
@Test public void testCurrentStackTrace() { String currentStackTrace = UtilAll.currentStackTrace(); assertThat(currentStackTrace).contains("UtilAll.currentStackTrace"); assertThat(currentStackTrace).contains("UtilAllTest.testCurrentStackTrace("); }
public static String currentStackTrace() { StringBuilder sb = new StringBuilder(); StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); for (StackTraceElement ste : stackTrace) { sb.append("\n\t"); sb.append(ste.toString()); } return sb.toString(); }
UtilAll { public static String currentStackTrace() { StringBuilder sb = new StringBuilder(); StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); for (StackTraceElement ste : stackTrace) { sb.append("\n\t"); sb.append(ste.toString()); } return sb.toString(); } }
UtilAll { public static String currentStackTrace() { StringBuilder sb = new StringBuilder(); StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); for (StackTraceElement ste : stackTrace) { sb.append("\n\t"); sb.append(ste.toString()); } return sb.toString(); } }
UtilAll { public static String currentStackTrace() { StringBuilder sb = new StringBuilder(); StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); for (StackTraceElement ste : stackTrace) { sb.append("\n\t"); sb.append(ste.toString()); } return sb.toString(); } static int getPid(); static String cur...
UtilAll { public static String currentStackTrace() { StringBuilder sb = new StringBuilder(); StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); for (StackTraceElement ste : stackTrace) { sb.append("\n\t"); sb.append(ste.toString()); } return sb.toString(); } static int getPid(); static String cur...
@Test public void testGetPid() { assertThat(UtilAll.getPid()).isGreaterThan(0); }
public static int getPid() { RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); String name = runtime.getName(); try { return Integer.parseInt(name.substring(0, name.indexOf('@'))); } catch (Exception e) { return -1; } }
UtilAll { public static int getPid() { RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); String name = runtime.getName(); try { return Integer.parseInt(name.substring(0, name.indexOf('@'))); } catch (Exception e) { return -1; } } }
UtilAll { public static int getPid() { RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); String name = runtime.getName(); try { return Integer.parseInt(name.substring(0, name.indexOf('@'))); } catch (Exception e) { return -1; } } }
UtilAll { public static int getPid() { RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); String name = runtime.getName(); try { return Integer.parseInt(name.substring(0, name.indexOf('@'))); } catch (Exception e) { return -1; } } static int getPid(); static String currentStackTrace(); static String offset2...
UtilAll { public static int getPid() { RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); String name = runtime.getName(); try { return Integer.parseInt(name.substring(0, name.indexOf('@'))); } catch (Exception e) { return -1; } } static int getPid(); static String currentStackTrace(); static String offset2...
@Test public void testGetDiskPartitionSpaceUsedPercent() { String tmpDir = System.getProperty("java.io.tmpdir"); assertThat(UtilAll.getDiskPartitionSpaceUsedPercent(null)).isCloseTo(-1, within(0.000001)); assertThat(UtilAll.getDiskPartitionSpaceUsedPercent("")).isCloseTo(-1, within(0.000001)); assertThat(UtilAll.getDis...
public static double getDiskPartitionSpaceUsedPercent(final String path) { if (null == path || path.isEmpty()) return -1; try { File file = new File(path); if (!file.exists()) return -1; long totalSpace = file.getTotalSpace(); if (totalSpace > 0) { long freeSpace = file.getFreeSpace(); long usedSpace = totalSpace - fre...
UtilAll { public static double getDiskPartitionSpaceUsedPercent(final String path) { if (null == path || path.isEmpty()) return -1; try { File file = new File(path); if (!file.exists()) return -1; long totalSpace = file.getTotalSpace(); if (totalSpace > 0) { long freeSpace = file.getFreeSpace(); long usedSpace = totalS...
UtilAll { public static double getDiskPartitionSpaceUsedPercent(final String path) { if (null == path || path.isEmpty()) return -1; try { File file = new File(path); if (!file.exists()) return -1; long totalSpace = file.getTotalSpace(); if (totalSpace > 0) { long freeSpace = file.getFreeSpace(); long usedSpace = totalS...
UtilAll { public static double getDiskPartitionSpaceUsedPercent(final String path) { if (null == path || path.isEmpty()) return -1; try { File file = new File(path); if (!file.exists()) return -1; long totalSpace = file.getTotalSpace(); if (totalSpace > 0) { long freeSpace = file.getFreeSpace(); long usedSpace = totalS...
UtilAll { public static double getDiskPartitionSpaceUsedPercent(final String path) { if (null == path || path.isEmpty()) return -1; try { File file = new File(path); if (!file.exists()) return -1; long totalSpace = file.getTotalSpace(); if (totalSpace > 0) { long freeSpace = file.getFreeSpace(); long usedSpace = totalS...
@Test public void testIsBlank() { assertThat(UtilAll.isBlank("Hello ")).isFalse(); assertThat(UtilAll.isBlank(" Hello")).isFalse(); assertThat(UtilAll.isBlank("He llo")).isFalse(); assertThat(UtilAll.isBlank(" ")).isTrue(); assertThat(UtilAll.isBlank("Hello")).isFalse(); }
public static boolean isBlank(String str) { int strLen; if (str == null || (strLen = str.length()) == 0) { return true; } for (int i = 0; i < strLen; i++) { if (!Character.isWhitespace(str.charAt(i))) { return false; } } return true; }
UtilAll { public static boolean isBlank(String str) { int strLen; if (str == null || (strLen = str.length()) == 0) { return true; } for (int i = 0; i < strLen; i++) { if (!Character.isWhitespace(str.charAt(i))) { return false; } } return true; } }
UtilAll { public static boolean isBlank(String str) { int strLen; if (str == null || (strLen = str.length()) == 0) { return true; } for (int i = 0; i < strLen; i++) { if (!Character.isWhitespace(str.charAt(i))) { return false; } } return true; } }
UtilAll { public static boolean isBlank(String str) { int strLen; if (str == null || (strLen = str.length()) == 0) { return true; } for (int i = 0; i < strLen; i++) { if (!Character.isWhitespace(str.charAt(i))) { return false; } } return true; } static int getPid(); static String currentStackTrace(); static String off...
UtilAll { public static boolean isBlank(String str) { int strLen; if (str == null || (strLen = str.length()) == 0) { return true; } for (int i = 0; i < strLen; i++) { if (!Character.isWhitespace(str.charAt(i))) { return false; } } return true; } static int getPid(); static String currentStackTrace(); static String off...
@Test public void testGetLocalInetAddress() throws Exception { List<String> localInetAddress = MixAll.getLocalInetAddress(); String local = InetAddress.getLocalHost().getHostAddress(); assertThat(localInetAddress).contains("127.0.0.1"); assertThat(localInetAddress).contains(local); }
public static List<String> getLocalInetAddress() { List<String> inetAddressList = new ArrayList<String>(); try { Enumeration<NetworkInterface> enumeration = NetworkInterface.getNetworkInterfaces(); while (enumeration.hasMoreElements()) { NetworkInterface networkInterface = enumeration.nextElement(); Enumeration<InetAdd...
MixAll { public static List<String> getLocalInetAddress() { List<String> inetAddressList = new ArrayList<String>(); try { Enumeration<NetworkInterface> enumeration = NetworkInterface.getNetworkInterfaces(); while (enumeration.hasMoreElements()) { NetworkInterface networkInterface = enumeration.nextElement(); Enumeratio...
MixAll { public static List<String> getLocalInetAddress() { List<String> inetAddressList = new ArrayList<String>(); try { Enumeration<NetworkInterface> enumeration = NetworkInterface.getNetworkInterfaces(); while (enumeration.hasMoreElements()) { NetworkInterface networkInterface = enumeration.nextElement(); Enumeratio...
MixAll { public static List<String> getLocalInetAddress() { List<String> inetAddressList = new ArrayList<String>(); try { Enumeration<NetworkInterface> enumeration = NetworkInterface.getNetworkInterfaces(); while (enumeration.hasMoreElements()) { NetworkInterface networkInterface = enumeration.nextElement(); Enumeratio...
MixAll { public static List<String> getLocalInetAddress() { List<String> inetAddressList = new ArrayList<String>(); try { Enumeration<NetworkInterface> enumeration = NetworkInterface.getNetworkInterfaces(); while (enumeration.hasMoreElements()) { NetworkInterface networkInterface = enumeration.nextElement(); Enumeratio...
@Test public void testBrokerVIPChannel() { assertThat(MixAll.brokerVIPChannel(true, "127.0.0.1:10911")).isEqualTo("127.0.0.1:10909"); }
public static String brokerVIPChannel(final boolean isChange, final String brokerAddr) { if (isChange) { String[] ipAndPort = brokerAddr.split(":"); String brokerAddrNew = ipAndPort[0] + ":" + (Integer.parseInt(ipAndPort[1]) - 2); return brokerAddrNew; } else { return brokerAddr; } }
MixAll { public static String brokerVIPChannel(final boolean isChange, final String brokerAddr) { if (isChange) { String[] ipAndPort = brokerAddr.split(":"); String brokerAddrNew = ipAndPort[0] + ":" + (Integer.parseInt(ipAndPort[1]) - 2); return brokerAddrNew; } else { return brokerAddr; } } }
MixAll { public static String brokerVIPChannel(final boolean isChange, final String brokerAddr) { if (isChange) { String[] ipAndPort = brokerAddr.split(":"); String brokerAddrNew = ipAndPort[0] + ":" + (Integer.parseInt(ipAndPort[1]) - 2); return brokerAddrNew; } else { return brokerAddr; } } }
MixAll { public static String brokerVIPChannel(final boolean isChange, final String brokerAddr) { if (isChange) { String[] ipAndPort = brokerAddr.split(":"); String brokerAddrNew = ipAndPort[0] + ":" + (Integer.parseInt(ipAndPort[1]) - 2); return brokerAddrNew; } else { return brokerAddr; } } static String getWSAddr()...
MixAll { public static String brokerVIPChannel(final boolean isChange, final String brokerAddr) { if (isChange) { String[] ipAndPort = brokerAddr.split(":"); String brokerAddrNew = ipAndPort[0] + ":" + (Integer.parseInt(ipAndPort[1]) - 2); return brokerAddrNew; } else { return brokerAddr; } } static String getWSAddr()...
@Test public void testFetchMasterAndSlaveDistinguish() throws InterruptedException, MQBrokerException, RemotingTimeoutException, RemotingSendRequestException, RemotingConnectException { Map<String, List<String>> result = CommandUtil.fetchMasterAndSlaveDistinguish(defaultMQAdminExtImpl, "default-cluster"); assertThat(re...
public static Map<String, List<String>> fetchMasterAndSlaveDistinguish( final MQAdminExt adminExt, final String clusterName) throws InterruptedException, RemotingConnectException, RemotingTimeoutException, RemotingSendRequestException, MQBrokerException { Map<String, List<String>> masterAndSlaveMap = new HashMap<String...
CommandUtil { public static Map<String, List<String>> fetchMasterAndSlaveDistinguish( final MQAdminExt adminExt, final String clusterName) throws InterruptedException, RemotingConnectException, RemotingTimeoutException, RemotingSendRequestException, MQBrokerException { Map<String, List<String>> masterAndSlaveMap = new ...
CommandUtil { public static Map<String, List<String>> fetchMasterAndSlaveDistinguish( final MQAdminExt adminExt, final String clusterName) throws InterruptedException, RemotingConnectException, RemotingTimeoutException, RemotingSendRequestException, MQBrokerException { Map<String, List<String>> masterAndSlaveMap = new ...
CommandUtil { public static Map<String, List<String>> fetchMasterAndSlaveDistinguish( final MQAdminExt adminExt, final String clusterName) throws InterruptedException, RemotingConnectException, RemotingTimeoutException, RemotingSendRequestException, MQBrokerException { Map<String, List<String>> masterAndSlaveMap = new ...
CommandUtil { public static Map<String, List<String>> fetchMasterAndSlaveDistinguish( final MQAdminExt adminExt, final String clusterName) throws InterruptedException, RemotingConnectException, RemotingTimeoutException, RemotingSendRequestException, MQBrokerException { Map<String, List<String>> masterAndSlaveMap = new ...
@Test public void whenEmptyWithEmptyValueThenInvokeThenWithConsumer(){ final boolean[] result = {false}; new Chain<>((TestClass)null, chainConfiguration) .whenEmpty() .then(new Consumer<TestClass>() { @Override public void accept(@NonNull TestClass testClass) throws Exception { result[0] = true; } }); assertTrue(result...
public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
@Test public void whenNotWithTruePredicateThenDoNotInvokeThenWithConsumer() { final boolean[] result = {false}; new Chain<>(new TestClass(), chainConfiguration) .apply(new Consumer<TestClass>() { @Override public void accept(@NonNull TestClass testClass) throws Exception { testClass.setText("!"); } }) .whenNot(new Pred...
public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
@Test public void whenNotWithTruePredicateThenDoNotInvokeAction() { final boolean[] result = {false}; new Chain<>(new TestClass(), chainConfiguration) .apply(new Consumer<TestClass>() { @Override public void accept(@NonNull TestClass testClass) throws Exception { testClass.setText("!"); } }) .whenNot(new Predicate<Test...
public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); }
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } }
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); }
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action); S invoke(Action action); Optional<R> t...
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action); S invoke(Action action); Optional<R> t...
@Test public void whenNotWithFalsePredicateThenInvokeThenWithConsumer() { final boolean[] result = {false}; TestClass testClass = new Chain<>(new TestClass(), chainConfiguration) .apply(new Consumer<TestClass>() { @Override public void accept(@NonNull TestClass testClass) throws Exception { testClass.setText("!"); } })...
public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
@Test public void whenNotWithFalsePredicateThenInvokeAction() { final boolean[] result = {false}; TestClass testClass = new Chain<>(new TestClass(), chainConfiguration) .apply(new Consumer<TestClass>() { @Override public void accept(@NonNull TestClass testClass) throws Exception { testClass.setText("!"); } }) .whenNot(...
public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); }
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } }
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); }
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action); S invoke(Action action); Optional<R> t...
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action); S invoke(Action action); Optional<R> t...
@Test(expected = UnsupportedOperationException.class) public void whenNotWithExceptionThenThrowException() { new Chain<>(new TestClass(), chainConfiguration) .apply(new Consumer<TestClass>() { @Override public void accept(@NonNull TestClass testClass) throws Exception { testClass.setText("!"); } }) .whenNot(new Predica...
public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
@Test(expected = UnsupportedOperationException.class) public void invokeActionWithExceptionThenThrowException() { new Chain<>(new TestClass(), chainConfiguration) .apply(new Consumer<TestClass>() { @Override public void accept(@NonNull TestClass testClass) throws Exception { testClass.setText("!"); } }) .when(new Predi...
public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); }
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } }
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); }
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action); S invoke(Action action); Optional<R> t...
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action); S invoke(Action action); Optional<R> t...
@Test public void thenMapWithValidConditionThenReturnAnOptionalContainingMappedValue() { TestClassTwo result = new Chain<>(new TestClass(), chainConfiguration) .when(new Predicate<TestClass>() { @Override public boolean test(TestClass testClass) throws Exception { return true; } }) .thenMap(new Function<TestClass, Test...
public <R> Optional<R> thenMap(Function<T, R> mapper) { if (isSourceChainUpdateAccepted()) { return new Optional<>(Invoker.invoke(mapper, sourceProxy.getItem()), sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenMap(Function<T, R> mapper) { if (isSourceChainUpdateAccepted()) { return new Optional<>(Invoker.invoke(mapper, sourceProxy.getItem()), sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }...
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenMap(Function<T, R> mapper) { if (isSourceChainUpdateAccepted()) { return new Optional<>(Invoker.invoke(mapper, sourceProxy.getItem()), sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }...
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenMap(Function<T, R> mapper) { if (isSourceChainUpdateAccepted()) { return new Optional<>(Invoker.invoke(mapper, sourceProxy.getItem()), sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }...
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenMap(Function<T, R> mapper) { if (isSourceChainUpdateAccepted()) { return new Optional<>(Invoker.invoke(mapper, sourceProxy.getItem()), sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }...
@Test public void thenMapWithInvalidConditionThenReturnAnOptionalContainingNull() { TestClassTwo result = new Chain<>(new TestClass(), chainConfiguration) .when(new Predicate<TestClass>() { @Override public boolean test(TestClass testClass) throws Exception { return false; } }) .thenMap(new Function<TestClass, TestClas...
public <R> Optional<R> thenMap(Function<T, R> mapper) { if (isSourceChainUpdateAccepted()) { return new Optional<>(Invoker.invoke(mapper, sourceProxy.getItem()), sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenMap(Function<T, R> mapper) { if (isSourceChainUpdateAccepted()) { return new Optional<>(Invoker.invoke(mapper, sourceProxy.getItem()), sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }...
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenMap(Function<T, R> mapper) { if (isSourceChainUpdateAccepted()) { return new Optional<>(Invoker.invoke(mapper, sourceProxy.getItem()), sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }...
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenMap(Function<T, R> mapper) { if (isSourceChainUpdateAccepted()) { return new Optional<>(Invoker.invoke(mapper, sourceProxy.getItem()), sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }...
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenMap(Function<T, R> mapper) { if (isSourceChainUpdateAccepted()) { return new Optional<>(Invoker.invoke(mapper, sourceProxy.getItem()), sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }...
@Test(expected = UnsupportedOperationException.class) public void thenMapWithExceptionThenThrowException() { new Chain<>(new TestClass(), chainConfiguration) .when(new Predicate<TestClass>() { @Override public boolean test(TestClass testClass) throws Exception { return true; } }) .thenMap(new Function<TestClass, TestCl...
public <R> Optional<R> thenMap(Function<T, R> mapper) { if (isSourceChainUpdateAccepted()) { return new Optional<>(Invoker.invoke(mapper, sourceProxy.getItem()), sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenMap(Function<T, R> mapper) { if (isSourceChainUpdateAccepted()) { return new Optional<>(Invoker.invoke(mapper, sourceProxy.getItem()), sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }...
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenMap(Function<T, R> mapper) { if (isSourceChainUpdateAccepted()) { return new Optional<>(Invoker.invoke(mapper, sourceProxy.getItem()), sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }...
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenMap(Function<T, R> mapper) { if (isSourceChainUpdateAccepted()) { return new Optional<>(Invoker.invoke(mapper, sourceProxy.getItem()), sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }...
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenMap(Function<T, R> mapper) { if (isSourceChainUpdateAccepted()) { return new Optional<>(Invoker.invoke(mapper, sourceProxy.getItem()), sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }...
@Test public void thenToItemWithValidConditionThenReturnAnOptionalContainingItem() { TestClassTwo result = new Chain<>(new TestClass(), chainConfiguration) .when(new Predicate<TestClass>() { @Override public boolean test(TestClass testClass) throws Exception { return true; } }) .thenTo(new TestClassTwo("1")) .defaultIf...
public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } }
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } private Condition(S source, Predicate<T> predi...
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } private Condition(S source, Predicate<T> predi...
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } private Condition(S source, Predicate<T> predi...
@Test public void whenNotEmptyWithNotEmptyValueThenInvokeThenWithConsumer(){ final boolean[] result = {false}; new Chain<>(new TestClass(), chainConfiguration) .whenNotEmpty() .then(new Consumer<TestClass>() { @Override public void accept(@NonNull TestClass testClass) throws Exception { result[0] = true; } }); assertTr...
public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
@Test public void thenToItemWithInvalidConditionThenReturnAnOptionalContainingNull() { TestClassTwo result = new Chain<>(new TestClass(), chainConfiguration) .when(new Predicate<TestClass>() { @Override public boolean test(TestClass testClass) throws Exception { return false; } }) .thenTo(new TestClassTwo("1")) .defaul...
public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } }
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } private Condition(S source, Predicate<T> predi...
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } private Condition(S source, Predicate<T> predi...
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } private Condition(S source, Predicate<T> predi...
@Test public void thenToCallableWithValidConditionThenReturnAnOptionalContainingMappedValue() { TestClassTwo result = new Chain<>(new TestClass(), chainConfiguration) .when(new Predicate<TestClass>() { @Override public boolean test(TestClass testClass) throws Exception { return true; } }) .thenTo(new Callable<TestClass...
public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } }
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } private Condition(S source, Predicate<T> predi...
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } private Condition(S source, Predicate<T> predi...
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } private Condition(S source, Predicate<T> predi...
@Test public void thenToCallableWithInvalidConditionThenReturnAnOptionalContainingNull() { TestClassTwo result = new Chain<>(new TestClass(), chainConfiguration) .when(new Predicate<TestClass>() { @Override public boolean test(TestClass testClass) throws Exception { return false; } }) .thenTo(new Callable<TestClassTwo>...
public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } }
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } private Condition(S source, Predicate<T> predi...
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } private Condition(S source, Predicate<T> predi...
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } private Condition(S source, Predicate<T> predi...
@Test(expected = UnsupportedOperationException.class) public void thenToCallableWithExceptionThenThrowException() { new Chain<>(new TestClass(), chainConfiguration) .when(new Predicate<TestClass>() { @Override public boolean test(TestClass testClass) throws Exception { return true; } }) .thenTo(new Callable<TestClassTw...
public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } }
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } }
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } private Condition(S source, Predicate<T> predi...
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } private Condition(S source, Predicate<T> predi...
Condition implements Internal<Condition<S, T>, T> { public <R> Optional<R> thenTo(@NonNull R item) { if (isSourceChainUpdateAccepted()) { return new Optional<>(item, sourceProxy.getConfiguration()); } else { return new Optional<>(null, sourceProxy.getConfiguration()); } } private Condition(S source, Predicate<T> predi...
@Test public void logWithSelfAsSourceThenReturnSelfAsSource() { Condition<?,?> source = Chain.let(0).when(new Predicate<Integer>() { @Override public boolean test(Integer integer) throws Exception { return false; } }); Logger<?, ?> logger = source.log("1"); assertEquals(source, logger.source); }
public Logger<Condition<S, T>, T> log(Object tag) { return new Logger<>(this, sourceProxy.getConfiguration(), tag); }
Condition implements Internal<Condition<S, T>, T> { public Logger<Condition<S, T>, T> log(Object tag) { return new Logger<>(this, sourceProxy.getConfiguration(), tag); } }
Condition implements Internal<Condition<S, T>, T> { public Logger<Condition<S, T>, T> log(Object tag) { return new Logger<>(this, sourceProxy.getConfiguration(), tag); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); }
Condition implements Internal<Condition<S, T>, T> { public Logger<Condition<S, T>, T> log(Object tag) { return new Logger<>(this, sourceProxy.getConfiguration(), tag); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action); S invoke(Action action); Optional<R> thenM...
Condition implements Internal<Condition<S, T>, T> { public Logger<Condition<S, T>, T> log(Object tag) { return new Logger<>(this, sourceProxy.getConfiguration(), tag); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action); S invoke(Action action); Optional<R> thenM...
@Test public void logWithStringTagThenReturnLoggerWithThatTag() { Condition<?,?> source = Chain.let(0).when(new Predicate<Integer>() { @Override public boolean test(Integer integer) throws Exception { return false; } }); Logger<?, ?> logger = source.log("1"); assertEquals("1", logger.tag); }
public Logger<Condition<S, T>, T> log(Object tag) { return new Logger<>(this, sourceProxy.getConfiguration(), tag); }
Condition implements Internal<Condition<S, T>, T> { public Logger<Condition<S, T>, T> log(Object tag) { return new Logger<>(this, sourceProxy.getConfiguration(), tag); } }
Condition implements Internal<Condition<S, T>, T> { public Logger<Condition<S, T>, T> log(Object tag) { return new Logger<>(this, sourceProxy.getConfiguration(), tag); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); }
Condition implements Internal<Condition<S, T>, T> { public Logger<Condition<S, T>, T> log(Object tag) { return new Logger<>(this, sourceProxy.getConfiguration(), tag); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action); S invoke(Action action); Optional<R> thenM...
Condition implements Internal<Condition<S, T>, T> { public Logger<Condition<S, T>, T> log(Object tag) { return new Logger<>(this, sourceProxy.getConfiguration(), tag); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action); S invoke(Action action); Optional<R> thenM...
@Test public void andWithMultipleItemsThenAppendAllToTheList() { Collector<Boolean> result = new Collector<Boolean>(configuration) .and(true) .and(false) .and(true); assertTrue(result.items.get(0) && !result.items.get(1) && result.items.get(2)); }
@Override public Collector<T> and(T item) { if (item != null) { items.add(item); } return copy(); }
Collector implements Internal<Collector<T>, List<T>>, And<T>, Monad<List<T>>, Functor<T> { @Override public Collector<T> and(T item) { if (item != null) { items.add(item); } return copy(); } }
Collector implements Internal<Collector<T>, List<T>>, And<T>, Monad<List<T>>, Functor<T> { @Override public Collector<T> and(T item) { if (item != null) { items.add(item); } return copy(); } Collector(InternalConfiguration configuration); }
Collector implements Internal<Collector<T>, List<T>>, And<T>, Monad<List<T>>, Functor<T> { @Override public Collector<T> and(T item) { if (item != null) { items.add(item); } return copy(); } Collector(InternalConfiguration configuration); @Override Collector<T> and(T item); Chain<List<T>...
Collector implements Internal<Collector<T>, List<T>>, And<T>, Monad<List<T>>, Functor<T> { @Override public Collector<T> and(T item) { if (item != null) { items.add(item); } return copy(); } Collector(InternalConfiguration configuration); @Override Collector<T> and(T item); Chain<List<T>...
@Test public void logWithSelfAsSourceThenReturnSelfAsSource() { Collector<?> source = Chain.let(0).collect(Integer.class); Logger<?, ?> logger = source.log("1"); assertEquals(source, logger.source); }
public Logger<Collector<T>, List<T>> log(Object tag) { return new Logger<>(this, configuration, tag); }
Collector implements Internal<Collector<T>, List<T>>, And<T>, Monad<List<T>>, Functor<T> { public Logger<Collector<T>, List<T>> log(Object tag) { return new Logger<>(this, configuration, tag); } }
Collector implements Internal<Collector<T>, List<T>>, And<T>, Monad<List<T>>, Functor<T> { public Logger<Collector<T>, List<T>> log(Object tag) { return new Logger<>(this, configuration, tag); } Collector(InternalConfiguration configuration); }
Collector implements Internal<Collector<T>, List<T>>, And<T>, Monad<List<T>>, Functor<T> { public Logger<Collector<T>, List<T>> log(Object tag) { return new Logger<>(this, configuration, tag); } Collector(InternalConfiguration configuration); @Override Collector<T> and(T item); Chain<Lis...
Collector implements Internal<Collector<T>, List<T>>, And<T>, Monad<List<T>>, Functor<T> { public Logger<Collector<T>, List<T>> log(Object tag) { return new Logger<>(this, configuration, tag); } Collector(InternalConfiguration configuration); @Override Collector<T> and(T item); Chain<Lis...
@Test public void logWithStringTagThenReturnLoggerWithThatTag() { Collector<?> source = Chain.let(0).collect(Integer.class); Logger<?, ?> logger = source.log("1"); assertEquals("1", logger.tag); }
public Logger<Collector<T>, List<T>> log(Object tag) { return new Logger<>(this, configuration, tag); }
Collector implements Internal<Collector<T>, List<T>>, And<T>, Monad<List<T>>, Functor<T> { public Logger<Collector<T>, List<T>> log(Object tag) { return new Logger<>(this, configuration, tag); } }
Collector implements Internal<Collector<T>, List<T>>, And<T>, Monad<List<T>>, Functor<T> { public Logger<Collector<T>, List<T>> log(Object tag) { return new Logger<>(this, configuration, tag); } Collector(InternalConfiguration configuration); }
Collector implements Internal<Collector<T>, List<T>>, And<T>, Monad<List<T>>, Functor<T> { public Logger<Collector<T>, List<T>> log(Object tag) { return new Logger<>(this, configuration, tag); } Collector(InternalConfiguration configuration); @Override Collector<T> and(T item); Chain<Lis...
Collector implements Internal<Collector<T>, List<T>>, And<T>, Monad<List<T>>, Functor<T> { public Logger<Collector<T>, List<T>> log(Object tag) { return new Logger<>(this, configuration, tag); } Collector(InternalConfiguration configuration); @Override Collector<T> and(T item); Chain<Lis...
@Test public void runCollectorProxyTester() { Collector<Integer> collector = new Collector<>(InternalConfiguration.getInstance("runCollectorProxyTester")); collector.and(1).and(2).and(3); new ProxyTester<>(collector, Arrays.asList(4, 5, 6)).run(); }
@Override public Collector<T> and(T item) { if (item != null) { items.add(item); } return copy(); }
Collector implements Internal<Collector<T>, List<T>>, And<T>, Monad<List<T>>, Functor<T> { @Override public Collector<T> and(T item) { if (item != null) { items.add(item); } return copy(); } }
Collector implements Internal<Collector<T>, List<T>>, And<T>, Monad<List<T>>, Functor<T> { @Override public Collector<T> and(T item) { if (item != null) { items.add(item); } return copy(); } Collector(InternalConfiguration configuration); }
Collector implements Internal<Collector<T>, List<T>>, And<T>, Monad<List<T>>, Functor<T> { @Override public Collector<T> and(T item) { if (item != null) { items.add(item); } return copy(); } Collector(InternalConfiguration configuration); @Override Collector<T> and(T item); Chain<List<T>...
Collector implements Internal<Collector<T>, List<T>>, And<T>, Monad<List<T>>, Functor<T> { @Override public Collector<T> and(T item) { if (item != null) { items.add(item); } return copy(); } Collector(InternalConfiguration configuration); @Override Collector<T> and(T item); Chain<List<T>...
@Test public void whenEmptyWithNonEmptyValueThenDoNotInvokeThenWithConsumer(){ final boolean[] result = {false}; new Chain<>(new TestClass(), chainConfiguration) .whenEmpty() .then(new Consumer<TestClass>() { @Override public void accept(@NonNull TestClass testClass) throws Exception { result[0] = true; } }); assertFal...
public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
@Test public void callWithSetTextOnTestClassThenFindTextValueUpdated() { final TestClass[] result = {new TestClass()}; Guard.call(new Callable<TestClass>() { @Override public TestClass call() throws Exception { result[0].text = "!"; return result[0]; } }); assertEquals("!", result[0].text); }
public static <T> Guard<Chain<T>, T> call(@NonNull Callable<T> callable) { return new Guard<>(new Chain<T>(null, InternalConfiguration.getInstance(null)).access(), callable); }
Guard implements Internal<Guard<S, T>, T> { public static <T> Guard<Chain<T>, T> call(@NonNull Callable<T> callable) { return new Guard<>(new Chain<T>(null, InternalConfiguration.getInstance(null)).access(), callable); } }
Guard implements Internal<Guard<S, T>, T> { public static <T> Guard<Chain<T>, T> call(@NonNull Callable<T> callable) { return new Guard<>(new Chain<T>(null, InternalConfiguration.getInstance(null)).access(), callable); } private Guard(Proxy<S, T> proxy, Exception error); Guard(Proxy<S, T> proxy, Callable<T> callable...
Guard implements Internal<Guard<S, T>, T> { public static <T> Guard<Chain<T>, T> call(@NonNull Callable<T> callable) { return new Guard<>(new Chain<T>(null, InternalConfiguration.getInstance(null)).access(), callable); } private Guard(Proxy<S, T> proxy, Exception error); Guard(Proxy<S, T> proxy, Callable<T> callable...
Guard implements Internal<Guard<S, T>, T> { public static <T> Guard<Chain<T>, T> call(@NonNull Callable<T> callable) { return new Guard<>(new Chain<T>(null, InternalConfiguration.getInstance(null)).access(), callable); } private Guard(Proxy<S, T> proxy, Exception error); Guard(Proxy<S, T> proxy, Callable<T> callable...
@Test public void callWithExceptionThenDoNotThrowException() { Guard.call(new Callable<TestClass>() { @Override public TestClass call() throws Exception { throw new UnsupportedOperationException(); } }); }
public static <T> Guard<Chain<T>, T> call(@NonNull Callable<T> callable) { return new Guard<>(new Chain<T>(null, InternalConfiguration.getInstance(null)).access(), callable); }
Guard implements Internal<Guard<S, T>, T> { public static <T> Guard<Chain<T>, T> call(@NonNull Callable<T> callable) { return new Guard<>(new Chain<T>(null, InternalConfiguration.getInstance(null)).access(), callable); } }
Guard implements Internal<Guard<S, T>, T> { public static <T> Guard<Chain<T>, T> call(@NonNull Callable<T> callable) { return new Guard<>(new Chain<T>(null, InternalConfiguration.getInstance(null)).access(), callable); } private Guard(Proxy<S, T> proxy, Exception error); Guard(Proxy<S, T> proxy, Callable<T> callable...
Guard implements Internal<Guard<S, T>, T> { public static <T> Guard<Chain<T>, T> call(@NonNull Callable<T> callable) { return new Guard<>(new Chain<T>(null, InternalConfiguration.getInstance(null)).access(), callable); } private Guard(Proxy<S, T> proxy, Exception error); Guard(Proxy<S, T> proxy, Callable<T> callable...
Guard implements Internal<Guard<S, T>, T> { public static <T> Guard<Chain<T>, T> call(@NonNull Callable<T> callable) { return new Guard<>(new Chain<T>(null, InternalConfiguration.getInstance(null)).access(), callable); } private Guard(Proxy<S, T> proxy, Exception error); Guard(Proxy<S, T> proxy, Callable<T> callable...
@Test public void runGuardProxyTester() { Guard<?, Integer> guard = Guard.call(new Callable<Integer>() { @Override public Integer call() throws Exception { return 0; } }); new ProxyTester<>(guard, 1).run(); }
public static <T> Guard<Chain<T>, T> call(@NonNull Callable<T> callable) { return new Guard<>(new Chain<T>(null, InternalConfiguration.getInstance(null)).access(), callable); }
Guard implements Internal<Guard<S, T>, T> { public static <T> Guard<Chain<T>, T> call(@NonNull Callable<T> callable) { return new Guard<>(new Chain<T>(null, InternalConfiguration.getInstance(null)).access(), callable); } }
Guard implements Internal<Guard<S, T>, T> { public static <T> Guard<Chain<T>, T> call(@NonNull Callable<T> callable) { return new Guard<>(new Chain<T>(null, InternalConfiguration.getInstance(null)).access(), callable); } private Guard(Proxy<S, T> proxy, Exception error); Guard(Proxy<S, T> proxy, Callable<T> callable...
Guard implements Internal<Guard<S, T>, T> { public static <T> Guard<Chain<T>, T> call(@NonNull Callable<T> callable) { return new Guard<>(new Chain<T>(null, InternalConfiguration.getInstance(null)).access(), callable); } private Guard(Proxy<S, T> proxy, Exception error); Guard(Proxy<S, T> proxy, Callable<T> callable...
Guard implements Internal<Guard<S, T>, T> { public static <T> Guard<Chain<T>, T> call(@NonNull Callable<T> callable) { return new Guard<>(new Chain<T>(null, InternalConfiguration.getInstance(null)).access(), callable); } private Guard(Proxy<S, T> proxy, Exception error); Guard(Proxy<S, T> proxy, Callable<T> callable...
@Test public void testWithNullFirstParameterAndNonNullSecondParameterThenReturnFalse() { assertFalse(new IsEqualComparator<Integer>().test(null, 0)); }
@Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } @Override boolean test(T leftItem, T rightItem); }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } @Override boolean test(T leftItem, T rightItem); }
@Test public void testWithNonNullFirstParameterAndNullSecondParameterThenReturnFalse() { assertFalse(new IsEqualComparator<Integer>().test(0, null)); }
@Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } @Override boolean test(T leftItem, T rightItem); }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } @Override boolean test(T leftItem, T rightItem); }
@Test public void testWithNullFirstParameterAndNullSecondParameterThenReturnTrue() { assertTrue(new IsEqualComparator<Integer>().test(null, null)); }
@Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } @Override boolean test(T leftItem, T rightItem); }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } @Override boolean test(T leftItem, T rightItem); }
@Test public void testWithNonEqualParametersThenReturnFalse() { assertFalse(new IsEqualComparator<Integer>().test(1, 0)); }
@Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } @Override boolean test(T leftItem, T rightItem); }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } @Override boolean test(T leftItem, T rightItem); }
@Test public void testWithEqualParametersThenReturnTrue() { assertTrue(new IsEqualComparator<Integer>().test(0, 0)); }
@Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } @Override boolean test(T leftItem, T rightItem); }
IsEqualComparator implements BiPredicate<T, T> { @Override public boolean test(T leftItem, T rightItem) { return (leftItem == null && rightItem == null) || (leftItem != null && leftItem.equals(rightItem)); } @Override boolean test(T leftItem, T rightItem); }
@Test public void debugWhileChainConfigIsDebuggingThenInvokeDebug() { InternalConfiguration config = InternalConfiguration .getInstance("debugWhileChainConfigIsDebuggingThenInvokeDebug"); config.setDebugging(true); final boolean[] result = {false}; new Optional<>(new TestClass(), config) .debug(new Consumer<TestClass>(...
public Optional<T> debug(Consumer<T> action) { if (chain.configuration.isDebugging() && chain.item != null) { Invoker.invoke(action, chain.item); } return new Optional<>(chain.item, chain.configuration); }
Optional implements Conditional<Optional<T>, T>, Internal<Optional<T>, T>, Function<Consumer<T>, Optional<T>>, DefaultIfEmpty<T>, Functor<T> { public Optional<T> debug(Consumer<T> action) { if (chain.configuration.isDebugging() && chain.item != null) { Invoker.invoke(action, chai...
Optional implements Conditional<Optional<T>, T>, Internal<Optional<T>, T>, Function<Consumer<T>, Optional<T>>, DefaultIfEmpty<T>, Functor<T> { public Optional<T> debug(Consumer<T> action) { if (chain.configuration.isDebugging() && chain.item != null) { Invoker.invoke(action, chai...
Optional implements Conditional<Optional<T>, T>, Internal<Optional<T>, T>, Function<Consumer<T>, Optional<T>>, DefaultIfEmpty<T>, Functor<T> { public Optional<T> debug(Consumer<T> action) { if (chain.configuration.isDebugging() && chain.item != null) { Invoker.invoke(action, chai...
Optional implements Conditional<Optional<T>, T>, Internal<Optional<T>, T>, Function<Consumer<T>, Optional<T>>, DefaultIfEmpty<T>, Functor<T> { public Optional<T> debug(Consumer<T> action) { if (chain.configuration.isDebugging() && chain.item != null) { Invoker.invoke(action, chai...
@Test public void debugWhileChainConfigIsNotDebuggingThenDoNotInvokeDebug() { InternalConfiguration config = InternalConfiguration .getInstance("debugWhileChainConfigIsNotDebuggingThenDoNotInvokeDebug"); config.setDebugging(false); final boolean[] result = {false}; new Optional<>(new TestClass(), config) .debug(new Con...
public Optional<T> debug(Consumer<T> action) { if (chain.configuration.isDebugging() && chain.item != null) { Invoker.invoke(action, chain.item); } return new Optional<>(chain.item, chain.configuration); }
Optional implements Conditional<Optional<T>, T>, Internal<Optional<T>, T>, Function<Consumer<T>, Optional<T>>, DefaultIfEmpty<T>, Functor<T> { public Optional<T> debug(Consumer<T> action) { if (chain.configuration.isDebugging() && chain.item != null) { Invoker.invoke(action, chai...
Optional implements Conditional<Optional<T>, T>, Internal<Optional<T>, T>, Function<Consumer<T>, Optional<T>>, DefaultIfEmpty<T>, Functor<T> { public Optional<T> debug(Consumer<T> action) { if (chain.configuration.isDebugging() && chain.item != null) { Invoker.invoke(action, chai...
Optional implements Conditional<Optional<T>, T>, Internal<Optional<T>, T>, Function<Consumer<T>, Optional<T>>, DefaultIfEmpty<T>, Functor<T> { public Optional<T> debug(Consumer<T> action) { if (chain.configuration.isDebugging() && chain.item != null) { Invoker.invoke(action, chai...
Optional implements Conditional<Optional<T>, T>, Internal<Optional<T>, T>, Function<Consumer<T>, Optional<T>>, DefaultIfEmpty<T>, Functor<T> { public Optional<T> debug(Consumer<T> action) { if (chain.configuration.isDebugging() && chain.item != null) { Invoker.invoke(action, chai...
@Test public void whenNotEmptyWithEmptyValueThenDoNotInvokeThenWithConsumer(){ final boolean[] result = {false}; new Chain<>((TestClass)null, chainConfiguration) .whenNotEmpty() .then(new Consumer<TestClass>() { @Override public void accept(@NonNull TestClass testClass) throws Exception { result[0] = true; } }); assert...
public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
@Test public void deferWithCallableThenAssignCallableVariableOnly() { Lazy<Boolean> lazyBoolean = Lazy.defer(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return true; } }); assertTrue(lazyBoolean.delayedAction != null && lazyBoolean.item == null); }
public static <T, P> Lazy<T> defer(Function<P, T> delayedInitializer, P parameter) { return new Lazy<>(Curry.toCallable(delayedInitializer, parameter)); }
Lazy implements Callable<T>, Monad<T>, Functor<T>, Function<Consumer<T>, Lazy<T>> { public static <T, P> Lazy<T> defer(Function<P, T> delayedInitializer, P parameter) { return new Lazy<>(Curry.toCallable(delayedInitializer, parameter)); } }
Lazy implements Callable<T>, Monad<T>, Functor<T>, Function<Consumer<T>, Lazy<T>> { public static <T, P> Lazy<T> defer(Function<P, T> delayedInitializer, P parameter) { return new Lazy<>(Curry.toCallable(delayedInitializer, parameter)); } Lazy(Callable<T> delayedAction); }
Lazy implements Callable<T>, Monad<T>, Functor<T>, Function<Consumer<T>, Lazy<T>> { public static <T, P> Lazy<T> defer(Function<P, T> delayedInitializer, P parameter) { return new Lazy<>(Curry.toCallable(delayedInitializer, parameter)); } Lazy(Callable<T> delayedAction); static Lazy<T> defer(Function<P, T> delayedIniti...
Lazy implements Callable<T>, Monad<T>, Functor<T>, Function<Consumer<T>, Lazy<T>> { public static <T, P> Lazy<T> defer(Function<P, T> delayedInitializer, P parameter) { return new Lazy<>(Curry.toCallable(delayedInitializer, parameter)); } Lazy(Callable<T> delayedAction); static Lazy<T> defer(Function<P, T> delayedIniti...
@Test public void testWithValidCollectionAndValidItemThenReturnTrue() { Collection<Integer> collection = Arrays.asList(1, 2, 3, 4); InternalConfiguration config = getInstance("testWithValidCollectionAndValidItemThenReturnTrue"); assertTrue(new InOperator<>(collection, new IsEqualComparator<Integer>(), config).test(2));...
@Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); }
InOperator implements Predicate<T> { @Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); } }
InOperator implements Predicate<T> { @Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); } InOperator(Collection<T> collection, ...
InOperator implements Predicate<T> { @Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); } InOperator(Collection<T> collection, ...
InOperator implements Predicate<T> { @Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); } InOperator(Collection<T> collection, ...
@Test public void testWithValidCollectionAndInvalidItemThenReturnFalse() { Collection<Integer> collection = Arrays.asList(1, 2, 3, 4); InternalConfiguration config = getInstance("testWithValidCollectionAndInvalidItemThenReturnFalse"); assertFalse(new InOperator<>(collection, new IsEqualComparator<Integer>(), config).te...
@Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); }
InOperator implements Predicate<T> { @Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); } }
InOperator implements Predicate<T> { @Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); } InOperator(Collection<T> collection, ...
InOperator implements Predicate<T> { @Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); } InOperator(Collection<T> collection, ...
InOperator implements Predicate<T> { @Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); } InOperator(Collection<T> collection, ...
@Test public void testWithValidCollectionAndNullItemThenReturnFalse() { Collection<Integer> collection = Arrays.asList(1, 2, 3, 4); InternalConfiguration config = getInstance("testWithValidCollectionAndNullItemThenReturnFalse"); assertFalse(new InOperator<>(collection, new IsEqualComparator<Integer>(), config).test(nul...
@Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); }
InOperator implements Predicate<T> { @Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); } }
InOperator implements Predicate<T> { @Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); } InOperator(Collection<T> collection, ...
InOperator implements Predicate<T> { @Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); } InOperator(Collection<T> collection, ...
InOperator implements Predicate<T> { @Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); } InOperator(Collection<T> collection, ...
@Test public void testWithNullCollectionAndValidItemThenReturnFalse() { InternalConfiguration config = getInstance("testWithNullCollectionAndValidItemThenReturnFalse"); assertFalse(new InOperator<>(null, new IsEqualComparator<Integer>(), config).test(2)); }
@Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); }
InOperator implements Predicate<T> { @Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); } }
InOperator implements Predicate<T> { @Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); } InOperator(Collection<T> collection, ...
InOperator implements Predicate<T> { @Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); } InOperator(Collection<T> collection, ...
InOperator implements Predicate<T> { @Override public boolean test(T item) { return item != null && !collection.isEmpty() && new Chain<>(collection, configuration) .apply(removeNulls()) .flatMap(toObservableFromIterable()) .any(hasComparatorTestPassed(item)) .blockingGet(); } InOperator(Collection<T> collection, ...
@Test public void callWithCallableThenReturnTheCallableResult() { TestClass testClass = Chain.call(new Callable<TestClass>() { @Override public TestClass call() throws Exception { return new TestClass("!"); } }).call(); assertEquals("!", testClass.text); }
public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.invoke(callable), InternalConfiguration.getInstance(null)); }
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.in...
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.in...
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.in...
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.in...
@Test(expected = UnsupportedOperationException.class) public void callWithCrashingCallableThenThrowException() { Chain.call(new Callable<TestClassTwo>() { @Override public TestClassTwo call() throws Exception { throw new UnsupportedOperationException(); } }); }
public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.invoke(callable), InternalConfiguration.getInstance(null)); }
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.in...
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.in...
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.in...
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.in...
@Test public void callWithValidCallableThenReturnTheValueOfCall() { TestClass testClass = Guard .call(new Callable<TestClass>() { @Override public TestClass call() throws Exception { return new TestClass("!"); } }) .onErrorReturnItem(new TestClass("!!")) .call(); assertEquals("!", testClass.text); }
public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.invoke(callable), InternalConfiguration.getInstance(null)); }
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.in...
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.in...
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.in...
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.in...
@Test public void callWithCrashingCallableThenReturnTheValueOfOnErrorReturnItem() { TestClass testClass = Guard .call(new Callable<TestClass>() { @Override public TestClass call() throws Exception { throw new UnsupportedOperationException(); } }) .onErrorReturnItem(new TestClass("!!")) .call(); assertEquals("!!", testC...
public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.invoke(callable), InternalConfiguration.getInstance(null)); }
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.in...
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.in...
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.in...
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public static <T> Chain<T> call(@NonNull Callable<T> callable) { return new Chain<>(Invoker.in...
@Test public void debugWhileChainConfigIsDebuggingThenInvokeDebug() { InternalConfiguration config = InternalConfiguration .getInstance("debugWhileChainConfigIsDebuggingThenInvokeDebug"); config.setDebugging(true); final boolean[] result = {false}; new Chain<>(new TestClass(), config) .debug(new Consumer<TestClass>() {...
public Chain<T> debug(Consumer<T> action) { if (configuration.isDebugging()) { Invoker.invoke(action, item); } return new Chain<>(item, configuration); }
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public Chain<T> debug(Consumer<T> action) { if (configuration.isDebugging()) { Invoker.invoke(...
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public Chain<T> debug(Consumer<T> action) { if (configuration.isDebugging()) { Invoker.invoke(...
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public Chain<T> debug(Consumer<T> action) { if (configuration.isDebugging()) { Invoker.invoke(...
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public Chain<T> debug(Consumer<T> action) { if (configuration.isDebugging()) { Invoker.invoke(...
@Test public void whenWithTruePredicateThenInvokeThenWithConsumer() { final boolean[] result = {false}; new Chain<>(new TestClass(), chainConfiguration) .apply(new Consumer<TestClass>() { @Override public void accept(@NonNull TestClass testClass) throws Exception { testClass.setText("!"); } }) .when(new Predicate<TestC...
public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
@Test public void debugWhileChainConfigIsNotDebuggingThenDoNotInvokeDebug() { InternalConfiguration config = InternalConfiguration .getInstance("debugWhileChainConfigIsNotDebuggingThenDoNotInvokeDebug"); config.setDebugging(false); final boolean[] result = {false}; new Chain<>(new TestClass(), config) .debug(new Consum...
public Chain<T> debug(Consumer<T> action) { if (configuration.isDebugging()) { Invoker.invoke(action, item); } return new Chain<>(item, configuration); }
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public Chain<T> debug(Consumer<T> action) { if (configuration.isDebugging()) { Invoker.invoke(...
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public Chain<T> debug(Consumer<T> action) { if (configuration.isDebugging()) { Invoker.invoke(...
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public Chain<T> debug(Consumer<T> action) { if (configuration.isDebugging()) { Invoker.invoke(...
Chain implements Conditional<Chain<T>, T>, Internal<Chain<T>, T>, Callable<T>, Function<Consumer<T>, Chain<T>>, DefaultIfEmpty<T>, And<T>, Monad<T>, Functor<T> { public Chain<T> debug(Consumer<T> action) { if (configuration.isDebugging()) { Invoker.invoke(...
@Test public void whenWithTruePredicateThenInvokeAction() { final boolean[] result = {false}; new Chain<>(new TestClass(), chainConfiguration) .apply(new Consumer<TestClass>() { @Override public void accept(@NonNull TestClass testClass) throws Exception { testClass.setText("!"); } }) .when(new Predicate<TestClass>() { ...
public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); }
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } }
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); }
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action); S invoke(Action action); Optional<R> t...
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action); S invoke(Action action); Optional<R> t...
@Test public void whenWithFalsePredicateThenDoNotInvokeThenWithConsumer() { final boolean[] result = {false}; TestClass testClass = new Chain<>(new TestClass(), chainConfiguration) .apply(new Consumer<TestClass>() { @Override public void accept(@NonNull TestClass testClass) throws Exception { testClass.setText("!"); } ...
public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
@Test public void whenWithFalsePredicateThenDoNotInvokeAction() { final boolean[] result = {false}; TestClass testClass = new Chain<>(new TestClass(), chainConfiguration) .apply(new Consumer<TestClass>() { @Override public void accept(@NonNull TestClass testClass) throws Exception { testClass.setText("!"); } }) .when(n...
public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); }
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } }
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); }
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action); S invoke(Action action); Optional<R> t...
Condition implements Internal<Condition<S, T>, T> { public S invoke(Action action) { if (isSourceChainUpdateAccepted()) Invoker.invoke(action); return sourceProxy.owner(); } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action); S invoke(Action action); Optional<R> t...
@Test(expected = UnsupportedOperationException.class) public void whenWithExceptionThenThrowException() { new Chain<>(new TestClass(), chainConfiguration) .apply(new Consumer<TestClass>() { @Override public void accept(@NonNull TestClass testClass) throws Exception { testClass.setText("!"); } }) .when(new Predicate<Tes...
public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
@Test(expected = UnsupportedOperationException.class) public void thenConsumerWithExceptionThenThrowException() { new Chain<>(new TestClass(), chainConfiguration) .apply(new Consumer<TestClass>() { @Override public void accept(@NonNull TestClass testClass) throws Exception { testClass.setText("!"); } }) .when(new Predi...
public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); }
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
Condition implements Internal<Condition<S, T>, T> { public S then(Consumer<T> action) { if (isSourceChainUpdateAccepted()) return Invoker.invoke(sourceProxy.owner(), action); else { return sourceProxy.owner(); } } private Condition(S source, Predicate<T> predicate, boolean negateExpression); S then(Consumer<T> action)...
@Test public void testRoot() { final Root root = mock(Root.class); final SuBinary binary = mock(SuBinary.class); final SuApp app = mock(SuApp.class); final SELinux seLinux = mock(SELinux.class); final RootContext.ContextSwitch contextSwitch = mock(RootContext.ContextSwitch.class); final RootContext rootContext = new Ro...
public boolean isRooted() { return root.getState() == Root.State.ROOTED; }
RootContext { public boolean isRooted() { return root.getState() == Root.State.ROOTED; } }
RootContext { public boolean isRooted() { return root.getState() == Root.State.ROOTED; } RootContext(Root root, SuBinary suBinary, SuApp suApp, SELinux seLinux, ContextSwitch contextSwitch); }
RootContext { public boolean isRooted() { return root.getState() == Root.State.ROOTED; } RootContext(Root root, SuBinary suBinary, SuApp suApp, SELinux seLinux, ContextSwitch contextSwitch); boolean isRooted(); Root getRoot(); SuBinary getSuBinary(); SuApp getSuApp(); SELinux getSELinux(); ContextSwitch getContextSwitc...
RootContext { public boolean isRooted() { return root.getState() == Root.State.ROOTED; } RootContext(Root root, SuBinary suBinary, SuApp suApp, SELinux seLinux, ContextSwitch contextSwitch); boolean isRooted(); Root getRoot(); SuBinary getSuBinary(); SuApp getSuApp(); SELinux getSELinux(); ContextSwitch getContextSwitc...
@Test public void testCall_normal() { when(session.submit(any(Cmd.class))).thenAnswer(invocation -> Single.just(new Cmd.Result(invocation.getArgument(0), Cmd.ExitCode.OK))); final SuBinary suBinary = new SuBinary.Builder().session(session).build().blockingGet(); assertThat(suBinary.getType(), is(SuBinary.Type.UNKNOWN))...
@NonNull public Type getType() { return type; }
SuBinary { @NonNull public Type getType() { return type; } }
SuBinary { @NonNull public Type getType() { return type; } SuBinary(Type type, @Nullable String path, @Nullable String version, @Nullable String extra, List<String> raw); }
SuBinary { @NonNull public Type getType() { return type; } SuBinary(Type type, @Nullable String path, @Nullable String version, @Nullable String extra, List<String> raw); @NonNull Type getType(); @Nullable String getPath(); String getExtra(); @Nullable String getVersion(); List<String> getRaw(); @Override String toStri...
SuBinary { @NonNull public Type getType() { return type; } SuBinary(Type type, @Nullable String path, @Nullable String version, @Nullable String extra, List<String> raw); @NonNull Type getType(); @Nullable String getPath(); String getExtra(); @Nullable String getVersion(); List<String> getRaw(); @Override String toStri...
@Test public void testCall_fallback() { when(session.submit(any(Cmd.class))).thenAnswer(invocation -> { Cmd cmd = invocation.getArgument(0); if (cmd.getCommands().size() == 1) { return Single.just(new Cmd.Result(invocation.getArgument(0), Cmd.ExitCode.PROBLEM)); } else { return Single.just(new Cmd.Result(invocation.get...
@NonNull public Type getType() { return type; }
SuBinary { @NonNull public Type getType() { return type; } }
SuBinary { @NonNull public Type getType() { return type; } SuBinary(Type type, @Nullable String path, @Nullable String version, @Nullable String extra, List<String> raw); }
SuBinary { @NonNull public Type getType() { return type; } SuBinary(Type type, @Nullable String path, @Nullable String version, @Nullable String extra, List<String> raw); @NonNull Type getType(); @Nullable String getPath(); String getExtra(); @Nullable String getVersion(); List<String> getRaw(); @Override String toStri...
SuBinary { @NonNull public Type getType() { return type; } SuBinary(Type type, @Nullable String path, @Nullable String version, @Nullable String extra, List<String> raw); @NonNull Type getType(); @Nullable String getPath(); String getExtra(); @Nullable String getVersion(); List<String> getRaw(); @Override String toStri...
@Test public void testEqualsHash() { SuBinary binary1 = new SuBinary(SuBinary.Type.SE_SUPERUSER, "/su/bin/su", "16", "me.phh.superuser cm-su", new ArrayList<>()); SuBinary binary2 = new SuBinary(SuBinary.Type.SE_SUPERUSER, "/su/bin/su", "16", "me.phh.superuser cm-su", new ArrayList<>()); SuBinary binary3 = new SuBinary...
@Override public int hashCode() { int result = type.hashCode(); result = 31 * result + (path != null ? path.hashCode() : 0); result = 31 * result + (extra != null ? extra.hashCode() : 0); result = 31 * result + (version != null ? version.hashCode() : 0); result = 31 * result + (raw != null ? raw.hashCode() : 0); return...
SuBinary { @Override public int hashCode() { int result = type.hashCode(); result = 31 * result + (path != null ? path.hashCode() : 0); result = 31 * result + (extra != null ? extra.hashCode() : 0); result = 31 * result + (version != null ? version.hashCode() : 0); result = 31 * result + (raw != null ? raw.hashCode() :...
SuBinary { @Override public int hashCode() { int result = type.hashCode(); result = 31 * result + (path != null ? path.hashCode() : 0); result = 31 * result + (extra != null ? extra.hashCode() : 0); result = 31 * result + (version != null ? version.hashCode() : 0); result = 31 * result + (raw != null ? raw.hashCode() :...
SuBinary { @Override public int hashCode() { int result = type.hashCode(); result = 31 * result + (path != null ? path.hashCode() : 0); result = 31 * result + (extra != null ? extra.hashCode() : 0); result = 31 * result + (version != null ? version.hashCode() : 0); result = 31 * result + (raw != null ? raw.hashCode() :...
SuBinary { @Override public int hashCode() { int result = type.hashCode(); result = 31 * result + (path != null ? path.hashCode() : 0); result = 31 * result + (extra != null ? extra.hashCode() : 0); result = 31 * result + (version != null ? version.hashCode() : 0); result = 31 * result + (raw != null ? raw.hashCode() :...
@Test public void testGetLineSeperator() { assertThat(LineReader.getLineSeparator(), is(notNullValue())); ApiWrap.setSDKInt(26); assertThat(LineReader.getLineSeparator(), is(System.lineSeparator())); ApiWrap.setSDKInt(16); assertThat(LineReader.getLineSeparator(), is(System.getProperty("line.separator", "\n"))); }
@SuppressLint("NewApi") public static String getLineSeparator() { if (ApiWrap.hasKitKat()) return System.lineSeparator(); else return System.getProperty("line.separator", "\n"); }
LineReader { @SuppressLint("NewApi") public static String getLineSeparator() { if (ApiWrap.hasKitKat()) return System.lineSeparator(); else return System.getProperty("line.separator", "\n"); } }
LineReader { @SuppressLint("NewApi") public static String getLineSeparator() { if (ApiWrap.hasKitKat()) return System.lineSeparator(); else return System.getProperty("line.separator", "\n"); } LineReader(); LineReader(String lineSeparator); }
LineReader { @SuppressLint("NewApi") public static String getLineSeparator() { if (ApiWrap.hasKitKat()) return System.lineSeparator(); else return System.getProperty("line.separator", "\n"); } LineReader(); LineReader(String lineSeparator); @SuppressLint("NewApi") static String getLineSeparator(); String readLine(Read...
LineReader { @SuppressLint("NewApi") public static String getLineSeparator() { if (ApiWrap.hasKitKat()) return System.lineSeparator(); else return System.getProperty("line.separator", "\n"); } LineReader(); LineReader(String lineSeparator); @SuppressLint("NewApi") static String getLineSeparator(); String readLine(Read...
@Test public void testLineEndings_linux() throws IOException { final List<String> output = new ArrayList<>(); final LineReader reader = new LineReader("\n"); Reader stream = new BufferedReader(new InputStreamReader(makeStream("line1\r\nline2\r\nli\rne\n\n"))); String line; while ((line = reader.readLine(stream)) != nul...
public String readLine(Reader reader) throws IOException { char curChar; int val; StringBuilder sb = new StringBuilder(40); while ((val = reader.read()) != -1) { curChar = (char) val; if (curChar == '\n' && lineSeparator.length == 1 && curChar == lineSeparator[0]) { return sb.toString(); } else if (curChar == '\r' && l...
LineReader { public String readLine(Reader reader) throws IOException { char curChar; int val; StringBuilder sb = new StringBuilder(40); while ((val = reader.read()) != -1) { curChar = (char) val; if (curChar == '\n' && lineSeparator.length == 1 && curChar == lineSeparator[0]) { return sb.toString(); } else if (curChar...
LineReader { public String readLine(Reader reader) throws IOException { char curChar; int val; StringBuilder sb = new StringBuilder(40); while ((val = reader.read()) != -1) { curChar = (char) val; if (curChar == '\n' && lineSeparator.length == 1 && curChar == lineSeparator[0]) { return sb.toString(); } else if (curChar...
LineReader { public String readLine(Reader reader) throws IOException { char curChar; int val; StringBuilder sb = new StringBuilder(40); while ((val = reader.read()) != -1) { curChar = (char) val; if (curChar == '\n' && lineSeparator.length == 1 && curChar == lineSeparator[0]) { return sb.toString(); } else if (curChar...
LineReader { public String readLine(Reader reader) throws IOException { char curChar; int val; StringBuilder sb = new StringBuilder(40); while ((val = reader.read()) != -1) { curChar = (char) val; if (curChar == '\n' && lineSeparator.length == 1 && curChar == lineSeparator[0]) { return sb.toString(); } else if (curChar...
@Test public void testLineEndings_windows() throws IOException { final List<String> output = new ArrayList<>(); final LineReader reader = new LineReader("\r\n"); Reader stream = new BufferedReader(new InputStreamReader(makeStream("line1\r\nline2\r\n\r\n"))); String line; while ((line = reader.readLine(stream)) != null)...
public String readLine(Reader reader) throws IOException { char curChar; int val; StringBuilder sb = new StringBuilder(40); while ((val = reader.read()) != -1) { curChar = (char) val; if (curChar == '\n' && lineSeparator.length == 1 && curChar == lineSeparator[0]) { return sb.toString(); } else if (curChar == '\r' && l...
LineReader { public String readLine(Reader reader) throws IOException { char curChar; int val; StringBuilder sb = new StringBuilder(40); while ((val = reader.read()) != -1) { curChar = (char) val; if (curChar == '\n' && lineSeparator.length == 1 && curChar == lineSeparator[0]) { return sb.toString(); } else if (curChar...
LineReader { public String readLine(Reader reader) throws IOException { char curChar; int val; StringBuilder sb = new StringBuilder(40); while ((val = reader.read()) != -1) { curChar = (char) val; if (curChar == '\n' && lineSeparator.length == 1 && curChar == lineSeparator[0]) { return sb.toString(); } else if (curChar...
LineReader { public String readLine(Reader reader) throws IOException { char curChar; int val; StringBuilder sb = new StringBuilder(40); while ((val = reader.read()) != -1) { curChar = (char) val; if (curChar == '\n' && lineSeparator.length == 1 && curChar == lineSeparator[0]) { return sb.toString(); } else if (curChar...
LineReader { public String readLine(Reader reader) throws IOException { char curChar; int val; StringBuilder sb = new StringBuilder(40); while ((val = reader.read()) != -1) { curChar = (char) val; if (curChar == '\n' && lineSeparator.length == 1 && curChar == lineSeparator[0]) { return sb.toString(); } else if (curChar...
@Test public void testLineEndings_legacy() throws IOException { final List<String> output = new ArrayList<>(); final LineReader reader = new LineReader("\r"); Reader stream = new BufferedReader(new InputStreamReader(makeStream("line1\n\rline2\n\rli\nne\r\r"))); String line; while ((line = reader.readLine(stream)) != nu...
public String readLine(Reader reader) throws IOException { char curChar; int val; StringBuilder sb = new StringBuilder(40); while ((val = reader.read()) != -1) { curChar = (char) val; if (curChar == '\n' && lineSeparator.length == 1 && curChar == lineSeparator[0]) { return sb.toString(); } else if (curChar == '\r' && l...
LineReader { public String readLine(Reader reader) throws IOException { char curChar; int val; StringBuilder sb = new StringBuilder(40); while ((val = reader.read()) != -1) { curChar = (char) val; if (curChar == '\n' && lineSeparator.length == 1 && curChar == lineSeparator[0]) { return sb.toString(); } else if (curChar...
LineReader { public String readLine(Reader reader) throws IOException { char curChar; int val; StringBuilder sb = new StringBuilder(40); while ((val = reader.read()) != -1) { curChar = (char) val; if (curChar == '\n' && lineSeparator.length == 1 && curChar == lineSeparator[0]) { return sb.toString(); } else if (curChar...
LineReader { public String readLine(Reader reader) throws IOException { char curChar; int val; StringBuilder sb = new StringBuilder(40); while ((val = reader.read()) != -1) { curChar = (char) val; if (curChar == '\n' && lineSeparator.length == 1 && curChar == lineSeparator[0]) { return sb.toString(); } else if (curChar...
LineReader { public String readLine(Reader reader) throws IOException { char curChar; int val; StringBuilder sb = new StringBuilder(40); while ((val = reader.read()) != -1) { curChar = (char) val; if (curChar == '\n' && lineSeparator.length == 1 && curChar == lineSeparator[0]) { return sb.toString(); } else if (curChar...
@Test public void testOpen_error() throws IOException { doReturn(Single.error(new InterruptedException())).when(rxProcess).open(); RxShell rxShell = new RxShell(rxProcess); TestObserver<RxShell.Session> sessionObs = rxShell.open().test(); sessionObs.awaitDone(1, TimeUnit.SECONDS).assertError(InterruptedException.class)...
public synchronized Single<Session> open() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("open()"); if (session == null) { session = rxProcess.open() .map(session -> { OutputStreamWriter writer = new OutputStreamWriter(session.input(), StandardCharsets.UTF_8); return new Session(session, writer); }) .subscribeOn(Schedule...
RxShell { public synchronized Single<Session> open() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("open()"); if (session == null) { session = rxProcess.open() .map(session -> { OutputStreamWriter writer = new OutputStreamWriter(session.input(), StandardCharsets.UTF_8); return new Session(session, writer); }) .subscribeO...
RxShell { public synchronized Single<Session> open() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("open()"); if (session == null) { session = rxProcess.open() .map(session -> { OutputStreamWriter writer = new OutputStreamWriter(session.input(), StandardCharsets.UTF_8); return new Session(session, writer); }) .subscribeO...
RxShell { public synchronized Single<Session> open() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("open()"); if (session == null) { session = rxProcess.open() .map(session -> { OutputStreamWriter writer = new OutputStreamWriter(session.input(), StandardCharsets.UTF_8); return new Session(session, writer); }) .subscribeO...
RxShell { public synchronized Single<Session> open() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("open()"); if (session == null) { session = rxProcess.open() .map(session -> { OutputStreamWriter writer = new OutputStreamWriter(session.input(), StandardCharsets.UTF_8); return new Session(session, writer); }) .subscribeO...
@Test public void testIsAlive() { RxShell rxShell = new RxShell(rxProcess); RxShell.Session session = rxShell.open().test().awaitCount(1).assertNoErrors().values().get(0); session.isAlive().test().awaitDone(1, TimeUnit.SECONDS).assertNoErrors().assertValue(true); when(rxProcessSession.isAlive()).thenReturn(Single.just(...
public synchronized Single<Boolean> isAlive() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("isAlive()"); if (session == null) return Single.just(false); else return session.flatMap(Session::isAlive); }
RxShell { public synchronized Single<Boolean> isAlive() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("isAlive()"); if (session == null) return Single.just(false); else return session.flatMap(Session::isAlive); } }
RxShell { public synchronized Single<Boolean> isAlive() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("isAlive()"); if (session == null) return Single.just(false); else return session.flatMap(Session::isAlive); } RxShell(RxProcess rxProcess); }
RxShell { public synchronized Single<Boolean> isAlive() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("isAlive()"); if (session == null) return Single.just(false); else return session.flatMap(Session::isAlive); } RxShell(RxProcess rxProcess); synchronized Single<Session> open(); synchronized Single<Boolean> isAlive(); sy...
RxShell { public synchronized Single<Boolean> isAlive() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("isAlive()"); if (session == null) return Single.just(false); else return session.flatMap(Session::isAlive); } RxShell(RxProcess rxProcess); synchronized Single<Session> open(); synchronized Single<Boolean> isAlive(); sy...
@Test public void testWaitFor() throws InterruptedException { RxShell rxShell = new RxShell(rxProcess); RxShell.Session session = rxShell.open().test().awaitDone(1, TimeUnit.SECONDS).assertNoErrors().values().get(0); assertThat(session.waitFor().test().await(1, TimeUnit.SECONDS), is(false)); waitForEmitter.onSuccess(55...
public synchronized Single<Session> open() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("open()"); if (session == null) { session = rxProcess.open() .map(session -> { OutputStreamWriter writer = new OutputStreamWriter(session.input(), StandardCharsets.UTF_8); return new Session(session, writer); }) .subscribeOn(Schedule...
RxShell { public synchronized Single<Session> open() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("open()"); if (session == null) { session = rxProcess.open() .map(session -> { OutputStreamWriter writer = new OutputStreamWriter(session.input(), StandardCharsets.UTF_8); return new Session(session, writer); }) .subscribeO...
RxShell { public synchronized Single<Session> open() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("open()"); if (session == null) { session = rxProcess.open() .map(session -> { OutputStreamWriter writer = new OutputStreamWriter(session.input(), StandardCharsets.UTF_8); return new Session(session, writer); }) .subscribeO...
RxShell { public synchronized Single<Session> open() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("open()"); if (session == null) { session = rxProcess.open() .map(session -> { OutputStreamWriter writer = new OutputStreamWriter(session.input(), StandardCharsets.UTF_8); return new Session(session, writer); }) .subscribeO...
RxShell { public synchronized Single<Session> open() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("open()"); if (session == null) { session = rxProcess.open() .map(session -> { OutputStreamWriter writer = new OutputStreamWriter(session.input(), StandardCharsets.UTF_8); return new Session(session, writer); }) .subscribeO...
@Test public void testContextSwitching_superSu() { when(suBinaryBuilder.build()).thenReturn(Single.just(new SuBinary(SuBinary.Type.CHAINFIRE_SUPERSU, null, null, null, new ArrayList<>()))); RootContext.Builder builder = new RootContext.Builder(context); builder.rootBuilder(rootBuilder); builder.seLinuxBuilder(seLinuxBu...
public ContextSwitch getContextSwitch() { return contextSwitch; }
RootContext { public ContextSwitch getContextSwitch() { return contextSwitch; } }
RootContext { public ContextSwitch getContextSwitch() { return contextSwitch; } RootContext(Root root, SuBinary suBinary, SuApp suApp, SELinux seLinux, ContextSwitch contextSwitch); }
RootContext { public ContextSwitch getContextSwitch() { return contextSwitch; } RootContext(Root root, SuBinary suBinary, SuApp suApp, SELinux seLinux, ContextSwitch contextSwitch); boolean isRooted(); Root getRoot(); SuBinary getSuBinary(); SuApp getSuApp(); SELinux getSELinux(); ContextSwitch getContextSwitch(); @Ove...
RootContext { public ContextSwitch getContextSwitch() { return contextSwitch; } RootContext(Root root, SuBinary suBinary, SuApp suApp, SELinux seLinux, ContextSwitch contextSwitch); boolean isRooted(); Root getRoot(); SuBinary getSuBinary(); SuApp getSuApp(); SELinux getSELinux(); ContextSwitch getContextSwitch(); @Ove...
@Test public void testCancel() { RxShell rxShell = new RxShell(rxProcess); RxShell.Session session = rxShell.open().test().awaitCount(1).assertNoErrors().values().get(0); session.isAlive().test().awaitDone(1, TimeUnit.SECONDS).assertNoErrors().assertValue(true); session.cancel().test().awaitDone(1, TimeUnit.SECONDS).as...
public synchronized Completable cancel() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("cancel()"); if (session == null) return Completable.complete(); else return session.flatMapCompletable(Session::cancel); }
RxShell { public synchronized Completable cancel() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("cancel()"); if (session == null) return Completable.complete(); else return session.flatMapCompletable(Session::cancel); } }
RxShell { public synchronized Completable cancel() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("cancel()"); if (session == null) return Completable.complete(); else return session.flatMapCompletable(Session::cancel); } RxShell(RxProcess rxProcess); }
RxShell { public synchronized Completable cancel() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("cancel()"); if (session == null) return Completable.complete(); else return session.flatMapCompletable(Session::cancel); } RxShell(RxProcess rxProcess); synchronized Single<Session> open(); synchronized Single<Boolean> isAli...
RxShell { public synchronized Completable cancel() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("cancel()"); if (session == null) return Completable.complete(); else return session.flatMapCompletable(Session::cancel); } RxShell(RxProcess rxProcess); synchronized Single<Session> open(); synchronized Single<Boolean> isAli...
@Test public void testClose() throws IOException { RxShell rxShell = new RxShell(rxProcess); RxShell.Session session = rxShell.open().test().awaitDone(10, TimeUnit.SECONDS).assertNoErrors().values().get(0); session.close().test().awaitDone(10, TimeUnit.SECONDS).assertNoErrors().assertValue(0); await().atMost(2, TimeUni...
public synchronized Single<Integer> close() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("close()"); if (session == null) return Single.just(0); else return session.flatMap(Session::close); }
RxShell { public synchronized Single<Integer> close() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("close()"); if (session == null) return Single.just(0); else return session.flatMap(Session::close); } }
RxShell { public synchronized Single<Integer> close() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("close()"); if (session == null) return Single.just(0); else return session.flatMap(Session::close); } RxShell(RxProcess rxProcess); }
RxShell { public synchronized Single<Integer> close() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("close()"); if (session == null) return Single.just(0); else return session.flatMap(Session::close); } RxShell(RxProcess rxProcess); synchronized Single<Session> open(); synchronized Single<Boolean> isAlive(); synchronized...
RxShell { public synchronized Single<Integer> close() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("close()"); if (session == null) return Single.just(0); else return session.flatMap(Session::close); } RxShell(RxProcess rxProcess); synchronized Single<Session> open(); synchronized Single<Boolean> isAlive(); synchronized...
@Test public void testOpen() { RxCmdShell rxCmdShell = new RxCmdShell(builder, rxShell); rxCmdShell.open().test().awaitCount(1).assertNoErrors(); verify(rxShell).open(); }
public synchronized Single<Session> open() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("open()"); if (session == null) { session = Single .create((SingleOnSubscribe<Session>) emitter -> rxShell.open().subscribe(new SingleObserver<RxShell.Session>() { @Override public void onSubscribe(Disposable d) { } @Override public ...
RxCmdShell { public synchronized Single<Session> open() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("open()"); if (session == null) { session = Single .create((SingleOnSubscribe<Session>) emitter -> rxShell.open().subscribe(new SingleObserver<RxShell.Session>() { @Override public void onSubscribe(Disposable d) { } @Ove...
RxCmdShell { public synchronized Single<Session> open() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("open()"); if (session == null) { session = Single .create((SingleOnSubscribe<Session>) emitter -> rxShell.open().subscribe(new SingleObserver<RxShell.Session>() { @Override public void onSubscribe(Disposable d) { } @Ove...
RxCmdShell { public synchronized Single<Session> open() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("open()"); if (session == null) { session = Single .create((SingleOnSubscribe<Session>) emitter -> rxShell.open().subscribe(new SingleObserver<RxShell.Session>() { @Override public void onSubscribe(Disposable d) { } @Ove...
RxCmdShell { public synchronized Single<Session> open() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("open()"); if (session == null) { session = Single .create((SingleOnSubscribe<Session>) emitter -> rxShell.open().subscribe(new SingleObserver<RxShell.Session>() { @Override public void onSubscribe(Disposable d) { } @Ove...