LongParser extends AbstractRedisClientProtocol<Long> { @Override public RedisClientProtocol<Long> read(ByteBuf byteBuf){ String data = readTilCRLFAsString(byteBuf); if(data == null){ return null; } if(data.charAt(0) != COLON_BYTE){ logger.debug("[read] first char expected is Colon (:)"); return new LongParser(Long.valueOf(data.trim())); } else { return new LongParser(Long.valueOf(data.substring(1).trim())); } } LongParser();  LongParser(Long payload);  LongParser(Integer payload);  LongParser(Long payload, boolean logRead, boolean logWrite); @Override RedisClientProtocol<Long> read(ByteBuf byteBuf); @Override boolean supportes(Class<?> clazz);  }
@Test public void read() throws Exception { System.out.println(""); RedisClientProtocol<Long> protocol = longParser.read(Unpooled.copiedBuffer(":1\r\n".getBytes())); Long payload = protocol.getPayload(); System.out.println(payload); }