Package com.fasterxml.jackson.jaxrs.cfg

Examples of com.fasterxml.jackson.jaxrs.cfg.AnnotationBundleKey


       Annotation[] ann1 = m1.getAnnotations();
       assertEquals(1, ann1.length);
       Annotation[] ann2 = m2.getAnnotations();
       assertEquals(1, ann2.length);

       AnnotationBundleKey key1 = new AnnotationBundleKey(ann1, Object.class);
       AnnotationBundleKey key2 = new AnnotationBundleKey(ann2, Object.class);
       AnnotationBundleKey key1dup = new AnnotationBundleKey(ann1, Object.class);
       AnnotationBundleKey key1immutable = key1.immutableKey();

       // identity checks first
       assertEquals(key1, key1);
       assertEquals(key2, key2);
       assertEquals(key1dup, key1dup);
       assertEquals(key1immutable, key1immutable);

       assertEquals(key1.hashCode(), key1dup.hashCode());
      
       // then inequality by content (even though both have 1 JSONP annotation)
       assertFalse(key1.equals(key2));
       assertFalse(key2.equals(key1));

       // but safe copy ought to be equal
       assertTrue(key1.equals(key1dup)); // from same method
       assertTrue(key1dup.equals(key1));
       assertTrue(key1.equals(key1immutable)); // and immutable variant
       assertTrue(key1immutable.equals(key1));
    }
View Full Code Here


      private ClassKey classKey;
      private int hash;

      private ClassAnnotationKey(Class<?> clazz, Annotation[] annotations)
      {
         this.annotations = new AnnotationBundleKey(annotations);
         this.classKey = new ClassKey(clazz);
         hash = this.annotations.hashCode();
         hash = 31 * hash + classKey.hashCode();
      }
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.jaxrs.cfg.AnnotationBundleKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.