Share via


Class.GetPermittedSubclasses Method

Definition

Returns an array containing Class objects representing the direct subinterfaces or subclasses permitted to extend or implement this class or interface if it is sealed.

[Android.Runtime.Register("getPermittedSubclasses", "()[Ljava/lang/Class;", "", ApiSince=34)]
public Java.Lang.Class[]? GetPermittedSubclasses ();
[<Android.Runtime.Register("getPermittedSubclasses", "()[Ljava/lang/Class;", "", ApiSince=34)>]
member this.GetPermittedSubclasses : unit -> Java.Lang.Class[]

Returns

Class[]

an array of Class objects of the permitted subclasses of this class or interface, or null if this class or interface is not sealed.

Attributes

Remarks

Returns an array containing Class objects representing the direct subinterfaces or subclasses permitted to extend or implement this class or interface if it is sealed. The order of such elements is unspecified. The array is empty if this sealed class or interface has no permitted subclass. If this Class object represents a primitive type, void, an array type, or a class or interface that is not sealed, that is #isSealed() returns false, then this method returns null. Conversely, if #isSealed() returns true, then this method returns a non-null value.

For each class or interface C which is recorded as a permitted direct subinterface or subclass of this class or interface, this method attempts to obtain the Class object for C (using #getClassLoader() the defining class loader of the current Class object). The Class objects which can be obtained and which are direct subinterfaces or subclasses of this class or interface, are indicated by elements of the returned array. If a Class object cannot be obtained, it is silently ignored, and not included in the result array.

Added in 17.

Java documentation for java.lang.Class.getPermittedSubclasses().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to