@Test public void testNullIntegers() { assertEquals( 0, comparator.compare( null, null ) ); String int1 = "1"; assertEquals( -1, comparator.compare( ( String ) null, int1 ) ); assertEquals( 1, comparator.compare( int1, ( String ) null ) ); }
@Override public int compare( Object v1, Object v2 ) { if ( v1 == null ) { if ( v2 == null ) { return 0; } else { return -1; } } else if ( v2 == null ) { return 1; } if ( v1 instanceof String ) { return compare( ( String ) v1, ( String ) v2 ); } else if ( v1 instanceof Value ) { return compare( ( ( Value ) v1 ).getString(), ( ( Value ) v2 ).getString() ); } else { return Long.compare( ( Long ) v1, ( Long ) v2 ); } }
IntegerComparator extends LdapComparator<Object> implements Serializable { @Override public int compare( Object v1, Object v2 ) { if ( v1 == null ) { if ( v2 == null ) { return 0; } else { return -1; } } else if ( v2 == null ) { return 1; } if ( v1 instanceof String ) { return compare( ( String ) v1, ( String ) v2 ); } else if ( v1 instanceof Value ) { return compare( ( ( Value ) v1 ).getString(), ( ( Value ) v2 ).getString() ); } else { return Long.compare( ( Long ) v1, ( Long ) v2 ); } } }
IntegerComparator extends LdapComparator<Object> implements Serializable { @Override public int compare( Object v1, Object v2 ) { if ( v1 == null ) { if ( v2 == null ) { return 0; } else { return -1; } } else if ( v2 == null ) { return 1; } if ( v1 instanceof String ) { return compare( ( String ) v1, ( String ) v2 ); } else if ( v1 instanceof Value ) { return compare( ( ( Value ) v1 ).getString(), ( ( Value ) v2 ).getString() ); } else { return Long.compare( ( Long ) v1, ( Long ) v2 ); } } IntegerComparator( String oid ); }
IntegerComparator extends LdapComparator<Object> implements Serializable { @Override public int compare( Object v1, Object v2 ) { if ( v1 == null ) { if ( v2 == null ) { return 0; } else { return -1; } } else if ( v2 == null ) { return 1; } if ( v1 instanceof String ) { return compare( ( String ) v1, ( String ) v2 ); } else if ( v1 instanceof Value ) { return compare( ( ( Value ) v1 ).getString(), ( ( Value ) v2 ).getString() ); } else { return Long.compare( ( Long ) v1, ( Long ) v2 ); } } IntegerComparator( String oid ); @Override int compare( Object v1, Object v2 ); }
IntegerComparator extends LdapComparator<Object> implements Serializable { @Override public int compare( Object v1, Object v2 ) { if ( v1 == null ) { if ( v2 == null ) { return 0; } else { return -1; } } else if ( v2 == null ) { return 1; } if ( v1 instanceof String ) { return compare( ( String ) v1, ( String ) v2 ); } else if ( v1 instanceof Value ) { return compare( ( ( Value ) v1 ).getString(), ( ( Value ) v2 ).getString() ); } else { return Long.compare( ( Long ) v1, ( Long ) v2 ); } } IntegerComparator( String oid ); @Override int compare( Object v1, Object v2 );  }