Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 1,126 for isInstance (0.06 sec)

  1. impl/maven-core/src/main/java/org/apache/maven/configuration/internal/EnhancedConfigurationConverter.java

                final ConfigurationListener listener)
                throws ComponentConfigurationException {
            final Object value = fromExpression(configuration, evaluator, type);
            if (type.isInstance(value)) {
                return value;
            }
            try {
                final Class<?> implType = getClassForImplementationHint(type, configuration, loader);
    Registered: Sun Nov 03 03:35:11 UTC 2024
    - Last Modified: Fri Oct 25 12:31:46 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/collect/Iterables.java

       * This does perform a little more work than necessary, so another option is to insert an
       * unchecked cast at some later point:
       *
       * <pre>
       * {@code @SuppressWarnings("unchecked") // safe because of ::isInstance check
       * ImmutableList<NewType> result =
       *     (ImmutableList) stream.filter(NewType.class::isInstance).collect(toImmutableList());}
       * </pre>
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Apr 24 19:38:27 UTC 2024
    - 42.8K bytes
    - Viewed (0)
  3. src/main/java/jcifs/pac/ASN1Util.java

         * @param object
         * @return object cast to type
         * @throws PACDecodingException
         */
        public static <T> T as ( Class<T> type, Object object ) throws PACDecodingException {
            if ( !type.isInstance(object) ) {
                throw new PACDecodingException("Incompatible object types " + type + " " + object.getClass());
            }
    
            return type.cast(object);
        }
    
    
        /**
         * 
    Registered: Sun Nov 03 00:10:13 UTC 2024
    - Last Modified: Mon Oct 02 12:02:06 UTC 2023
    - 6.5K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java

          }
          Thread.sleep(1);
        }
      }
    
      private static boolean isThreadBlockedOnInstanceOf(Thread t, Class<?> blocker) {
        return t.getState() == Thread.State.WAITING && blocker.isInstance(LockSupport.getBlocker(t));
      }
    
      static final class SlowChannel extends AbstractInterruptibleChannel {
        final CountDownLatch exitClose = new CountDownLatch(1);
    
        @Override
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 22:10:29 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  5. guava/src/com/google/common/reflect/Parameter.java

      }
    
      @Override
      @CheckForNull
      public <A extends Annotation> A getAnnotation(Class<A> annotationType) {
        checkNotNull(annotationType);
        for (Annotation annotation : annotations) {
          if (annotationType.isInstance(annotation)) {
            return annotationType.cast(annotation);
          }
        }
        return null;
      }
    
      @Override
      public Annotation[] getAnnotations() {
        return getDeclaredAnnotations();
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Nov 16 15:12:31 UTC 2023
    - 4.6K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/RecordedResponse.kt

      }
    
      fun assertFailure(vararg allowedExceptionTypes: Class<*>) =
        apply {
          var found = false
          for (expectedClass in allowedExceptionTypes) {
            if (expectedClass.isInstance(failure)) {
              found = true
              break
            }
          }
          assertThat(
            found,
            "Expected exception type among ${allowedExceptionTypes.contentToString()}, got $failure",
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  7. guava/src/com/google/common/hash/LittleEndianByteArray.java

                      Class<Unsafe> k = Unsafe.class;
                      for (Field f : k.getDeclaredFields()) {
                        f.setAccessible(true);
                        Object x = f.get(null);
                        if (k.isInstance(x)) {
                          return k.cast(x);
                        }
                      }
                      throw new NoSuchFieldError("the Unsafe");
                    });
          } catch (PrivilegedActionException e) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 9.8K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/internal/-UtilJvm.kt

    internal fun <T> readFieldOrNull(
      instance: Any,
      fieldType: Class<T>,
      fieldName: String,
    ): T? {
      var c: Class<*> = instance.javaClass
      while (c != Any::class.java) {
        try {
          val field = c.getDeclaredField(fieldName)
          field.isAccessible = true
          val value = field.get(instance)
          return if (!fieldType.isInstance(value)) null else fieldType.cast(value)
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon May 13 13:42:37 UTC 2024
    - 10.7K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/cache/Striped64.java

                  Class<Unsafe> k = Unsafe.class;
                  for (Field f : k.getDeclaredFields()) {
                    f.setAccessible(true);
                    Object x = f.get(null);
                    if (k.isInstance(x)) return k.cast(x);
                  }
                  throw new NoSuchFieldError("the Unsafe");
                }
              });
        } catch (PrivilegedActionException e) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Jun 14 17:55:55 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  10. guava/src/com/google/common/base/Throwables.java

       */
      @GwtIncompatible // Class.cast, Class.isInstance
      public static <X extends Throwable> void throwIfInstanceOf(
          Throwable throwable, Class<X> declaredType) throws X {
        checkNotNull(throwable);
        if (declaredType.isInstance(throwable)) {
          throw declaredType.cast(throwable);
        }
      }
    
      /**
       * Propagates {@code throwable} exactly as-is, if and only if it is an instance of {@code
       * declaredType}. Example usage:
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Jul 19 16:02:36 UTC 2024
    - 20.7K bytes
    - Viewed (0)
Back to top