Tabnine Logo
TypeDef.isAssignableFrom
Code IndexAdd Tabnine to your IDE (free)

How to use
isAssignableFrom
method
in
io.sundr.codegen.model.TypeDef

Best Java code snippets using io.sundr.codegen.model.TypeDef.isAssignableFrom (Showing top 3 results out of 315)

origin: sundrio/sundrio

/**
 * Checks if a type is an descendant of an other type
 *
 * @param item      The base type.
 * @param candidate The candidate type.
 * @return true if candidate is a descendant of base type.
 */
public static boolean isDescendant(TypeDef item, TypeDef candidate) {
  if (item == null || candidate == null) {
    return false;
  } else if (candidate.isAssignableFrom(item)) {
    return true;
  }
  return false;
}
origin: sundrio/sundrio

public boolean isAssignableFrom(TypeDef o) {
  if (this == o || this.equals(o)) {
    return true;
  }
  if (packageName == null && "java.lang".equals(o.packageName) && name.equalsIgnoreCase(o.name)) {
    return true;
  }
  if (o.packageName == null && "java.lang".equals(packageName) && name.equalsIgnoreCase(o.name)) {
    return true;
  }
  for (ClassRef e : o.getExtendsList()) {
    if (isAssignableFrom(e.getDefinition())) {
      return true;
    }
  }
  for (ClassRef i : o.getImplementsList()) {
    if (isAssignableFrom(i.getDefinition())) {
      return true;
    }
  }
  return false;
}
origin: sundrio/sundrio

public boolean isAssignableFrom(TypeRef other) {
  if (this == other) {
    return true;
  } else if (other == null) {
    return false;
  } else if (other instanceof PrimitiveRef) {
    if (getDefinition() == null) {
      return false;
    }
    if (getDefinition() != null && !JAVA_LANG.equals(getDefinition().getPackageName())) {
      return false;
    }
    if (!getDefinition().getName().toUpperCase().startsWith(((PrimitiveRef) other).getName().toUpperCase())) {
      return false;
    }
    return true;
  }
  if (!(other instanceof ClassRef)) {
    return false;
  }
  if (this == other || this.equals(other)) {
    return true;
  }
  return definition.isAssignableFrom(((ClassRef) other).getDefinition());
}
io.sundr.codegen.modelTypeDefisAssignableFrom

Popular methods of TypeDef

  • getFullyQualifiedName
    Returns the fully qualified name of the type.
  • getName
  • getPackageName
  • equals
  • getAttributes
  • getConstructors
  • getExtendsList
  • getMethods
  • getParameters
  • getProperties
  • toInternalReference
    Creates a ClassRef for internal use inside the scope of the type (methods, properties etc). It uses
  • toReference
  • toInternalReference,
  • toReference,
  • getAnnotations,
  • getAttribute,
  • getImplementsList,
  • getKind,
  • hasAttribute,
  • isAbstract,
  • toUnboundedReference

Popular in Java

  • Reactive rest calls using spring rest template
  • onCreateOptionsMenu (Activity)
  • getSystemService (Context)
  • getContentResolver (Context)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JFrame (javax.swing)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now