Size
annotation Size
Denotes that the annotated element should have a given size or length. Note that "-1" means "unset". Typically used with a parameter or return value of type array or collection.
Example:
{@code * public void getLocationInWindow(@Size(2) int[] location) { * ... * } * }
Summary
Public methods |
|
|---|---|
abstract @NonNull long |
max()A maximum size, inclusive |
abstract @NonNull long |
min()A minimum size, inclusive |
abstract @NonNull long |
multiple()The size must be a multiple of this factor |
abstract @NonNull long |
value()An exact size (or -1 if not specified) |
Extension functions |
|
|---|---|
final @RequiresApi(value = "21") int |
SizeKt.component1(@NonNull Size receiver)Returns "width", the first component of this |
final @RequiresApi(value = "21") int |
SizeKt.component2(@NonNull Size receiver)Returns "height", the second component of this |
Public methods
Extension functions
SizeKt.component1
@RequiresApi(value = "21")
@NonNull
public final @RequiresApi(value = "21") int SizeKt.component1(@NonNull Size receiver)
Returns "width", the first component of this Size.
This method allows to use destructuring declarations when working with sizes, for example:
val (w, h) = mySize
SizeKt.component2
@RequiresApi(value = "21")
@NonNull
public final @RequiresApi(value = "21") int SizeKt.component2(@NonNull Size receiver)
Returns "height", the second component of this Size.
This method allows to use destructuring declarations when working with sizes, for example:
val (w, h) = mySize