Interface Type

    • Method Detail

      • getId

        long getId()
        Returns:
        unique type ID
      • isBuiltin

        boolean isBuiltin()
        Returns:
        is the type built-in or a custom type
      • isSimple

        boolean isSimple()
        A simple type has only one field which is of a built-in type
        Returns:
        true if the type is 'simple'
      • isResolved

        boolean isResolved()
        Returns:
        true if the type is fully resolved
      • hasConstantPool

        boolean hasConstantPool()
        Returns:
        is the type using constant pool
      • getSupertype

        String getSupertype()
        Returns:
        the super type - may be null
      • getFields

        List<? extends TypedField> getFields()
        Returns:
        the type field structure
      • getField

        TypedField getField​(String name)
        Parameters:
        name - field name
        Returns:
        the field instance
      • getAnnotations

        List<Annotation> getAnnotations()
        Returns:
        attached annotations
      • canAccept

        boolean canAccept​(Object value)
        Checks whether the type can accept the given value
        Parameters:
        value - the value to check
        Returns:
        true only if the type can safely hold the value
        Throws:
        IllegalArgumentException - if the type can not accept the given value
      • asValue

        TypedValue asValue​(byte value)
        Shortcut for wrapping the given value instance as a TypedValue object
        Parameters:
        value - the value to wrap
        Returns:
        a TypedValue object representing the typed value
        Throws:
        IllegalArgumentException - if the type can not accept the given value
      • asValue

        TypedValue asValue​(char value)
        Shortcut for wrapping the given value instance as a TypedValue object
        Parameters:
        value - the value to wrap
        Returns:
        a TypedValue object representing the typed value
        Throws:
        IllegalArgumentException - if the type can not accept the given value
      • asValue

        TypedValue asValue​(short value)
        Shortcut for wrapping the given value instance as a TypedValue object
        Parameters:
        value - the value to wrap
        Returns:
        a TypedValue object representing the typed value
        Throws:
        IllegalArgumentException - if the type can not accept the given value
      • asValue

        TypedValue asValue​(int value)
        Shortcut for wrapping the given value instance as a TypedValue object
        Parameters:
        value - the value to wrap
        Returns:
        a TypedValue object representing the typed value
        Throws:
        IllegalArgumentException - if the type can not accept the given value
      • asValue

        TypedValue asValue​(long value)
        Shortcut for wrapping the given value instance as a TypedValue object
        Parameters:
        value - the value to wrap
        Returns:
        a TypedValue object representing the typed value
        Throws:
        IllegalArgumentException - if the type can not accept the given value
      • asValue

        TypedValue asValue​(float value)
        Shortcut for wrapping the given value instance as a TypedValue object
        Parameters:
        value - the value to wrap
        Returns:
        a TypedValue object representing the typed value
        Throws:
        IllegalArgumentException - if the type can not accept the given value
      • asValue

        TypedValue asValue​(double value)
        Shortcut for wrapping the given value instance as a TypedValue object
        Parameters:
        value - the value to wrap
        Returns:
        a TypedValue object representing the typed value
        Throws:
        IllegalArgumentException - if the type can not accept the given value
      • asValue

        TypedValue asValue​(boolean value)
        Shortcut for wrapping the given value instance as a TypedValue object
        Parameters:
        value - the value to wrap
        Returns:
        a TypedValue object representing the typed value
        Throws:
        IllegalArgumentException - if the type can not accept the given value
      • nullValue

        TypedValue nullValue()
        Returns:
        a specific TypedValue instance designated as the null value for this type
      • isUsedBy

        boolean isUsedBy​(Type other)
        Checks whether this particular type is used as a field type in the other type.
        Parameters:
        other - the other type
        Returns:
        true if any of the fields in 'other' type are of this particular type
      • getTypes

        Types getTypes()
        Returns:
        the associated Types helper class instance