Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for getEnumConstants (0.11 sec)

  1. guava/src/com/google/common/base/Platform.java

        return matcher.precomputedInternal();
      }
    
      static <T extends Enum<T>> Optional<T> getEnumIfPresent(Class<T> enumClass, String value) {
        WeakReference<? extends Enum<?>> ref = Enums.getEnumConstants(enumClass).get(value);
        /*
         * We use `fromNullable` instead of `of` because `WeakReference.get()` has a nullable return
         * type.
         *
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Apr 15 22:32:14 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  2. guava/src/com/google/common/base/Enums.java

        }
        enumConstantCache.put(enumClass, result);
        return result;
      }
    
      @GwtIncompatible // java.lang.ref.WeakReference
      static <T extends Enum<T>> Map<String, WeakReference<? extends Enum<?>>> getEnumConstants(
          Class<T> enumClass) {
        synchronized (enumConstantCache) {
          Map<String, WeakReference<? extends Enum<?>>> constants = enumConstantCache.get(enumClass);
          if (constants == null) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri May 26 11:56:44 UTC 2023
    - 5K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/base/EnumsTest.java

          assertThat(result).isPresent();
          shadowConstants.add(result.get());
        }
        assertEquals(ImmutableSet.<Object>copyOf(shadowTestEnum.getEnumConstants()), shadowConstants);
        Optional<TestEnum> result = Enums.getIfPresent(shadowTestEnum, "blibby");
        assertThat(result).isAbsent();
        return new WeakReference<>(shadowLoader);
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed May 29 16:29:37 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/base/Enums.java

        }
        enumConstantCache.put(enumClass, result);
        return result;
      }
    
      @GwtIncompatible // java.lang.ref.WeakReference
      static <T extends Enum<T>> Map<String, WeakReference<? extends Enum<?>>> getEnumConstants(
          Class<T> enumClass) {
        synchronized (enumConstantCache) {
          Map<String, WeakReference<? extends Enum<?>>> constants = enumConstantCache.get(enumClass);
          if (constants == null) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri May 26 11:56:44 UTC 2023
    - 5K bytes
    - Viewed (0)
  5. build-logic/documentation/src/main/groovy/gradlebuild/docs/dsl/links/ClassLinkMetaData.java

            for (MethodMetaData method : classMetaData.getDeclaredMethods()) {
                addMethod(method, style);
            }
            for (EnumConstantMetaData enumConstant : classMetaData.getEnumConstants()) {
                addEnumConstant(enumConstant, style);
            }
        }
    
        public LinkMetaData getClassLink() {
            return new LinkMetaData(style, simpleName, null);
        }
    
    Registered: Wed Nov 06 11:36:14 UTC 2024
    - Last Modified: Wed Dec 09 08:14:05 UTC 2020
    - 7.4K bytes
    - Viewed (0)
  6. build-logic/documentation/src/main/groovy/gradlebuild/docs/dsl/source/model/ClassMetaData.java

            return constants;
        }
    
        public void addEnumConstant(String name) {
            enumConstants.add(new EnumConstantMetaData(name, this));
        }
    
        public List<EnumConstantMetaData> getEnumConstants() {
            return enumConstants;
        }
    
        public EnumConstantMetaData getEnumConstant(String name) {
            for (EnumConstantMetaData enumConstant : enumConstants) {
    Registered: Wed Nov 06 11:36:14 UTC 2024
    - Last Modified: Wed Dec 09 08:14:05 UTC 2020
    - 10.1K bytes
    - Viewed (0)
  7. guava/src/com/google/common/util/concurrent/FuturesGetChecked.java

            @SuppressWarnings("rawtypes") // class literals
            Class<? extends Enum> theClass =
                Class.forName(CLASS_VALUE_VALIDATOR_NAME).asSubclass(Enum.class);
            return (GetCheckedTypeValidator) theClass.getEnumConstants()[0];
          } catch (ClassNotFoundException
              | RuntimeException
              | Error t) { // ensure we really catch *everything*
            return weakSetValidator();
          }
        }
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Feb 22 17:40:56 UTC 2024
    - 11.9K bytes
    - Viewed (0)
  8. android/guava-testlib/src/com/google/common/testing/ArbitraryInstances.java

        }
        Class<? extends T> implementation = getImplementation(type);
        if (implementation != null) {
          return get(implementation);
        }
        if (type.isEnum()) {
          T[] enumConstants = type.getEnumConstants();
          return (enumConstants == null || enumConstants.length == 0) ? null : enumConstants[0];
        }
        if (type.isArray()) {
          return createEmptyArray(type);
        }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 20.8K bytes
    - Viewed (0)
  9. guava-testlib/src/com/google/common/testing/ArbitraryInstances.java

          return get(implementation);
        }
        if (type == Stream.class) {
          return type.cast(Stream.empty());
        }
        if (type.isEnum()) {
          T[] enumConstants = type.getEnumConstants();
          return (enumConstants == null || enumConstants.length == 0) ? null : enumConstants[0];
        }
        if (type.isArray()) {
          return createEmptyArray(type);
        }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 21.2K bytes
    - Viewed (0)
  10. guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java

       */
      @VisibleForTesting
      static <E extends Enum<E>> Map<E, LockGraphNode> createNodes(Class<E> clazz) {
        EnumMap<E, LockGraphNode> map = Maps.newEnumMap(clazz);
        E[] keys = clazz.getEnumConstants();
        int numKeys = keys.length;
        ArrayList<LockGraphNode> nodes = Lists.newArrayListWithCapacity(numKeys);
        // Create a LockGraphNode for each enum value.
        for (E key : keys) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Dec 15 19:31:54 UTC 2023
    - 35.9K bytes
    - Viewed (0)
Back to top