@SuppressWarnings( "EqualsWithItself" ) @Test public void compareTo() { final ChannelAddress address1 = new ChannelAddress( 1, 1 ); final ChannelAddress address2 = new ChannelAddress( 1, 2, 1 ); assertEquals( address1.compareTo( address1 ), 0 ); assertEquals( address1.compareTo( address2 ), -1 ); assertEquals( address2.compareTo( address1 ), 1 ); assertEquals( address2.compareTo( address2 ), 0 ); }
@Override public int compareTo( @Nonnull final ChannelAddress o ) { final int systemDiff = Integer.compare( getSystemId(), o.getSystemId() ); return 0 == systemDiff ? Integer.compare( getChannelId(), o.getChannelId() ) : systemDiff; }
ChannelAddress implements Comparable<ChannelAddress> { @Override public int compareTo( @Nonnull final ChannelAddress o ) { final int systemDiff = Integer.compare( getSystemId(), o.getSystemId() ); return 0 == systemDiff ? Integer.compare( getChannelId(), o.getChannelId() ) : systemDiff; } }
ChannelAddress implements Comparable<ChannelAddress> { @Override public int compareTo( @Nonnull final ChannelAddress o ) { final int systemDiff = Integer.compare( getSystemId(), o.getSystemId() ); return 0 == systemDiff ? Integer.compare( getChannelId(), o.getChannelId() ) : systemDiff; } ChannelAddress( final int systemId, final int channelId );  ChannelAddress( final int systemId, final int channelId, @Nullable final Integer id ); }
ChannelAddress implements Comparable<ChannelAddress> { @Override public int compareTo( @Nonnull final ChannelAddress o ) { final int systemDiff = Integer.compare( getSystemId(), o.getSystemId() ); return 0 == systemDiff ? Integer.compare( getChannelId(), o.getChannelId() ) : systemDiff; } 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> { @Override public int compareTo( @Nonnull final ChannelAddress o ) { final int systemDiff = Integer.compare( getSystemId(), o.getSystemId() ); return 0 == systemDiff ? Integer.compare( getChannelId(), o.getChannelId() ) : systemDiff; } 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 );  }