@Test public void typeComparison() { final UUID uuid = UUIDGenerator.newTimeUUID(); final String firstType = "test1"; final String secondType = "test2"; SimpleId first = new SimpleId( uuid, firstType ); SimpleId second = new SimpleId( uuid, secondType ); assertTrue( first.compareTo( second ) < 0 ); assertTrue( first.compareTo( first ) == 0 ); assertTrue( second.compareTo( first ) > 0 ); }
@Override public int compareTo( final Id o ) { int compare = UUIDComparator.staticCompare( uuid, o.getUuid() ); if(compare == 0){ compare = type.compareTo( o.getType() ); } return compare; }
SimpleId implements Id, Serializable { @Override public int compareTo( final Id o ) { int compare = UUIDComparator.staticCompare( uuid, o.getUuid() ); if(compare == 0){ compare = type.compareTo( o.getType() ); } return compare; } }
SimpleId implements Id, Serializable { @Override public int compareTo( final Id o ) { int compare = UUIDComparator.staticCompare( uuid, o.getUuid() ); if(compare == 0){ compare = type.compareTo( o.getType() ); } return compare; } @SuppressWarnings( "unused" )  SimpleId();  SimpleId( final UUID uuid, final String type );  SimpleId( final String type ); }
SimpleId implements Id, Serializable { @Override public int compareTo( final Id o ) { int compare = UUIDComparator.staticCompare( uuid, o.getUuid() ); if(compare == 0){ compare = type.compareTo( o.getType() ); } return compare; } @SuppressWarnings( "unused" )  SimpleId();  SimpleId( final UUID uuid, final String type );  SimpleId( final String type ); @Override UUID getUuid(); @Override String getType(); @SuppressWarnings( "unused" ) void setType( final String type ); @SuppressWarnings( "unused" ) void setUuid( final UUID uuid ); @Override boolean equals( final Object o ); @Override int hashCode(); @Override String toString(); @Override int compareTo( final Id o ); }
SimpleId implements Id, Serializable { @Override public int compareTo( final Id o ) { int compare = UUIDComparator.staticCompare( uuid, o.getUuid() ); if(compare == 0){ compare = type.compareTo( o.getType() ); } return compare; } @SuppressWarnings( "unused" )  SimpleId();  SimpleId( final UUID uuid, final String type );  SimpleId( final String type ); @Override UUID getUuid(); @Override String getType(); @SuppressWarnings( "unused" ) void setType( final String type ); @SuppressWarnings( "unused" ) void setUuid( final UUID uuid ); @Override boolean equals( final Object o ); @Override int hashCode(); @Override String toString(); @Override int compareTo( final Id o );  }