Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 139 for unwrap (0.19 sec)

  1. guava-tests/test/com/google/common/primitives/PrimitivesTest.java

      public void testWrap() {
        assertThat(Primitives.wrap(int.class)).isSameInstanceAs(Integer.class);
        assertThat(Primitives.wrap(Integer.class)).isSameInstanceAs(Integer.class);
        assertThat(Primitives.wrap(String.class)).isSameInstanceAs(String.class);
      }
    
      public void testUnwrap() {
        assertThat(Primitives.unwrap(Integer.class)).isSameInstanceAs(int.class);
        assertThat(Primitives.unwrap(int.class)).isSameInstanceAs(int.class);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Thu Jun 01 09:32:35 GMT 2023
    - 3K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/primitives/Primitives.java

       * returns {@code type} itself. Idempotent.
       *
       * <pre>
       *     unwrap(Integer.class) == int.class
       *     unwrap(int.class) == int.class
       *     unwrap(String.class) == String.class
       * </pre>
       */
      public static <T> Class<T> unwrap(Class<T> type) {
        checkNotNull(type);
    
        // cast is safe: long.class and Long.class are both of type Class<Long>
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Oct 05 19:04:25 GMT 2022
    - 4.5K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/reflect/TypeToken.java

       * this} itself. Idempotent.
       *
       * @since 15.0
       */
      public final TypeToken<T> unwrap() {
        if (isWrapper()) {
          @SuppressWarnings("unchecked") // this is a wrapper class
          Class<T> type = (Class<T>) runtimeType;
          return of(Primitives.unwrap(type));
        }
        return this;
      }
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Jun 26 21:02:13 GMT 2023
    - 53.6K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/primitives/PrimitivesTest.java

      public void testWrap() {
        assertThat(Primitives.wrap(int.class)).isSameInstanceAs(Integer.class);
        assertThat(Primitives.wrap(Integer.class)).isSameInstanceAs(Integer.class);
        assertThat(Primitives.wrap(String.class)).isSameInstanceAs(String.class);
      }
    
      public void testUnwrap() {
        assertThat(Primitives.unwrap(Integer.class)).isSameInstanceAs(int.class);
        assertThat(Primitives.unwrap(int.class)).isSameInstanceAs(int.class);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Jun 01 09:32:35 GMT 2023
    - 3K bytes
    - Viewed (0)
  5. guava-testlib/src/com/google/common/testing/ArbitraryInstances.java

          return (enumConstants == null || enumConstants.length == 0) ? null : enumConstants[0];
        }
        if (type.isArray()) {
          return createEmptyArray(type);
        }
        T jvmDefault = Defaults.defaultValue(Primitives.unwrap(type));
        if (jvmDefault != null) {
          return jvmDefault;
        }
        if (Modifier.isAbstract(type.getModifiers()) || !Modifier.isPublic(type.getModifiers())) {
          return arbitraryConstantInstanceOrNull(type);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Apr 17 16:33:44 GMT 2024
    - 21K bytes
    - Viewed (1)
  6. android/guava-testlib/src/com/google/common/testing/ArbitraryInstances.java

          return (enumConstants == null || enumConstants.length == 0) ? null : enumConstants[0];
        }
        if (type.isArray()) {
          return createEmptyArray(type);
        }
        T jvmDefault = Defaults.defaultValue(Primitives.unwrap(type));
        if (jvmDefault != null) {
          return jvmDefault;
        }
        if (Modifier.isAbstract(type.getModifiers()) || !Modifier.isPublic(type.getModifiers())) {
          return arbitraryConstantInstanceOrNull(type);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Apr 17 16:33:44 GMT 2024
    - 20.5K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/reflect/TypeTokenTest.java

        assertEquals(TypeToken.of(Primitives.wrap((Class<?>) type.getType())), type.wrap());
      }
    
      private static void assertNotPrimitive(TypeToken<?> type) {
        assertFalse(type.isPrimitive());
        assertSame(type, type.wrap());
      }
    
      private static void assertIsWrapper(TypeToken<?> type) {
        assertNotPrimitive(type);
        assertEquals(TypeToken.of(Primitives.unwrap((Class<?>) type.getType())), type.unwrap());
      }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 22 17:15:24 GMT 2024
    - 88.7K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/cache/CacheBuilderFactory.java

       * method wraps the elements in the input sets (which may contain null) as Optionals, calls
       * Sets.cartesianProduct with those, then transforms the result to unwrap the Optionals.
       */
      private Iterable<List<Object>> buildCartesianProduct(Set<?>... sets) {
        List<Set<Optional<?>>> optionalSets = Lists.newArrayListWithExpectedSize(sets.length);
        for (Set<?> set : sets) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 8.1K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/cache/CacheBuilderFactory.java

       * method wraps the elements in the input sets (which may contain null) as Optionals, calls
       * Sets.cartesianProduct with those, then transforms the result to unwrap the Optionals.
       */
      private Iterable<List<Object>> buildCartesianProduct(Set<?>... sets) {
        List<Set<Optional<?>>> optionalSets = Lists.newArrayListWithExpectedSize(sets.length);
        for (Set<?> set : sets) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 8.1K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/collect/ImmutableListCopyOfConcurrentlyModifiedInputTest.java

         */
        runConcurrentlyMutatedTest(elements(), ops(add(1), add(2)), wrap);
    
        runConcurrentlyMutatedTest(elements(), ops(add(1), nop()), wrap);
    
        runConcurrentlyMutatedTest(elements(), ops(add(1), remove()), wrap);
    
        runConcurrentlyMutatedTest(elements(), ops(nop(), add(1)), wrap);
    
        runConcurrentlyMutatedTest(elements(1), ops(remove(), nop()), wrap);
    
        runConcurrentlyMutatedTest(elements(1), ops(remove(), add(2)), wrap);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 20:09:59 GMT 2024
    - 6.6K bytes
    - Viewed (0)
Back to top