Java 类org.hibernate.internal.util.compare.ComparableComparator 实例源码

项目:lams    文件:AbstractTypeDescriptor.java   
/**
 * Initialize a type descriptor for the given type.  Assumed immutable.
 *
 * @param type The Java type.
 * @param mutabilityPlan The plan for handling mutability aspects of the java type.
 */
@SuppressWarnings({ "unchecked" })
protected AbstractTypeDescriptor(Class<T> type, MutabilityPlan<T> mutabilityPlan) {
    this.type = type;
    this.mutabilityPlan = mutabilityPlan;
    this.comparator = Comparable.class.isAssignableFrom( type )
            ? (Comparator<T>) ComparableComparator.INSTANCE
            : null;

    JavaTypeDescriptorRegistry.INSTANCE.addDescriptor( this );
}
项目:hibernate-semantic-query    文件:AbstractTypeDescriptor.java   
/**
 * Initialize a type descriptor for the given type.  Assumed immutable.
 *
 * @param javaType The Java type.
 * @param mutabilityPlan The plan for handling mutability aspects of the java type.
 */
@SuppressWarnings({ "unchecked" })
protected AbstractTypeDescriptor(Class<T> javaType, MutabilityPlan<T> mutabilityPlan) {
    this(
            javaType,
            mutabilityPlan,
            Comparable.class.isAssignableFrom( javaType )
                    ? (Comparator<T>) ComparableComparator.INSTANCE
                    : null
    );
}
项目:hazelcast-hibernate5    文件:ValueTest.java   
@Test
public void testIsReplaceableByVersionBefore() throws Exception {
    String expectedValue = "Some value";
    Value value = new Value(10, 100L, expectedValue);
    assertFalse(value.isReplaceableBy(99L, 9, ComparableComparator.INSTANCE));
}
项目:hazelcast-hibernate5    文件:ValueTest.java   
@Test
public void testIsReplaceableByVersionEqual() throws Exception {
    String expectedValue = "Some value";
    Value value = new Value(10, 100L, expectedValue);
    assertFalse(value.isReplaceableBy(101L, 10, ComparableComparator.INSTANCE));
}
项目:hazelcast-hibernate5    文件:ValueTest.java   
@Test
public void testIsReplaceableByVersionAfter() throws Exception {
    String expectedValue = "Some value";
    Value value = new Value(10, 100L, expectedValue);
    assertTrue(value.isReplaceableBy(99L, 11, ComparableComparator.INSTANCE));
}
项目:hazelcast-hibernate5    文件:ExpiryMarkerTest.java   
@Test
public void testIsReplaceableByVersionBefore() throws Exception {
    ExpiryMarker marker = new ExpiryMarker(10, 150L, "the-marker-id").expire(100L);
    assertFalse("marker is replaceable when it when version before",
            marker.isReplaceableBy(101L, 9, ComparableComparator.INSTANCE));
}
项目:hazelcast-hibernate5    文件:ExpiryMarkerTest.java   
@Test
public void testIsReplaceableByVersionEqual() throws Exception {
    ExpiryMarker marker = new ExpiryMarker(10, 150L, "the-marker-id").expire(100L);
    assertFalse("marker is replaceable when it when version equal",
            marker.isReplaceableBy(101L, 10, ComparableComparator.INSTANCE));
}
项目:hazelcast-hibernate5    文件:ExpiryMarkerTest.java   
@Test
public void testIsReplaceableByVersionAfter() throws Exception {
    ExpiryMarker marker = new ExpiryMarker(10, 150L, "the-marker-id").expire(100L);
    assertTrue("marker is replaceable when it when version after",
            marker.isReplaceableBy(99L, 11, ComparableComparator.INSTANCE));
}
项目:hazelcast-hibernate    文件:ValueTest.java   
@Test
public void testIsReplaceableByVersionBefore() throws Exception {
    String expectedValue = "Some value";
    Value value = new Value(10, 100L, expectedValue);
    assertFalse(value.isReplaceableBy(99L, 9, ComparableComparator.INSTANCE));
}
项目:hazelcast-hibernate    文件:ValueTest.java   
@Test
public void testIsReplaceableByVersionEqual() throws Exception {
    String expectedValue = "Some value";
    Value value = new Value(10, 100L, expectedValue);
    assertFalse(value.isReplaceableBy(101L, 10, ComparableComparator.INSTANCE));
}
项目:hazelcast-hibernate    文件:ValueTest.java   
@Test
public void testIsReplaceableByVersionAfter() throws Exception {
    String expectedValue = "Some value";
    Value value = new Value(10, 100L, expectedValue);
    assertTrue(value.isReplaceableBy(99L, 11, ComparableComparator.INSTANCE));
}
项目:hazelcast-hibernate    文件:ExpiryMarkerTest.java   
@Test
public void testIsReplaceableByVersionBefore() throws Exception {
    ExpiryMarker marker = new ExpiryMarker(10, 150L, "the-marker-id").expire(100L);
    assertFalse("marker is replaceable when it when version before",
            marker.isReplaceableBy(101L, 9, ComparableComparator.INSTANCE));
}
项目:hazelcast-hibernate    文件:ExpiryMarkerTest.java   
@Test
public void testIsReplaceableByVersionEqual() throws Exception {
    ExpiryMarker marker = new ExpiryMarker(10, 150L, "the-marker-id").expire(100L);
    assertFalse("marker is replaceable when it when version equal",
            marker.isReplaceableBy(101L, 10, ComparableComparator.INSTANCE));
}
项目:hazelcast-hibernate    文件:ExpiryMarkerTest.java   
@Test
public void testIsReplaceableByVersionAfter() throws Exception {
    ExpiryMarker marker = new ExpiryMarker(10, 150L, "the-marker-id").expire(100L);
    assertTrue("marker is replaceable when it when version after",
            marker.isReplaceableBy(99L, 11, ComparableComparator.INSTANCE));
}
项目:sakai    文件:InstantType.java   
@Override
public Comparator<Instant> getComparator() {
    return ComparableComparator.INSTANCE;
}
项目:sakai    文件:InstantType.java   
@Override
public Comparator<Instant> getComparator() {
    return ComparableComparator.INSTANCE;
}