@Test public void parse() { final ChannelAddress address = ChannelAddress.parse( 4, "77" ); assertEquals( address.getSystemId(), 4 ); assertEquals( address.getChannelId(), 77 ); assertEquals( address.getId(), null ); }
@Nonnull public static ChannelAddress parse( final int schema, @Nonnull final String channel ) { final int offset = channel.indexOf( ".", 1 ); final int channelId = Integer.parseInt( -1 == offset ? channel : channel.substring( 0, offset ) ); final Integer subChannelId = -1 == offset ? null : Integer.parseInt( channel.substring( offset + 1 ) ); return new ChannelAddress( schema, channelId, subChannelId ); }
ChannelAddress implements Comparable<ChannelAddress> { @Nonnull public static ChannelAddress parse( final int schema, @Nonnull final String channel ) { final int offset = channel.indexOf( ".", 1 ); final int channelId = Integer.parseInt( -1 == offset ? channel : channel.substring( 0, offset ) ); final Integer subChannelId = -1 == offset ? null : Integer.parseInt( channel.substring( offset + 1 ) ); return new ChannelAddress( schema, channelId, subChannelId ); } }
ChannelAddress implements Comparable<ChannelAddress> { @Nonnull public static ChannelAddress parse( final int schema, @Nonnull final String channel ) { final int offset = channel.indexOf( ".", 1 ); final int channelId = Integer.parseInt( -1 == offset ? channel : channel.substring( 0, offset ) ); final Integer subChannelId = -1 == offset ? null : Integer.parseInt( channel.substring( offset + 1 ) ); return new ChannelAddress( schema, channelId, subChannelId ); } ChannelAddress( final int systemId, final int channelId );  ChannelAddress( final int systemId, final int channelId, @Nullable final Integer id ); }
ChannelAddress implements Comparable<ChannelAddress> { @Nonnull public static ChannelAddress parse( final int schema, @Nonnull final String channel ) { final int offset = channel.indexOf( ".", 1 ); final int channelId = Integer.parseInt( -1 == offset ? channel : channel.substring( 0, offset ) ); final Integer subChannelId = -1 == offset ? null : Integer.parseInt( channel.substring( offset + 1 ) ); return new ChannelAddress( schema, channelId, subChannelId ); } ChannelAddress( final int systemId, final int channelId );  ChannelAddress( final int systemId, final int channelId, @Nullable final Integer id ); int getSystemId(); int getChannelId(); @Nullable Integer getId(); @Override String toString(); @Nonnull String getName(); @Nonnull String asChannelDescriptor(); @Nonnull String getCacheKey(); @Nonnull static ChannelAddress parse( final int schema, @Nonnull final String channel ); @Override boolean equals( final Object o ); @Override int hashCode(); @Override int compareTo( @Nonnull final ChannelAddress o ); }
ChannelAddress implements Comparable<ChannelAddress> { @Nonnull public static ChannelAddress parse( final int schema, @Nonnull final String channel ) { final int offset = channel.indexOf( ".", 1 ); final int channelId = Integer.parseInt( -1 == offset ? channel : channel.substring( 0, offset ) ); final Integer subChannelId = -1 == offset ? null : Integer.parseInt( channel.substring( offset + 1 ) ); return new ChannelAddress( schema, channelId, subChannelId ); } ChannelAddress( final int systemId, final int channelId );  ChannelAddress( final int systemId, final int channelId, @Nullable final Integer id ); int getSystemId(); int getChannelId(); @Nullable Integer getId(); @Override String toString(); @Nonnull String getName(); @Nonnull String asChannelDescriptor(); @Nonnull String getCacheKey(); @Nonnull static ChannelAddress parse( final int schema, @Nonnull final String channel ); @Override boolean equals( final Object o ); @Override int hashCode(); @Override int compareTo( @Nonnull final ChannelAddress o );  }