Size
@Documented @Retention(value = CLASS) @Target(value = ) 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:
public void getLocationInWindow(@Size(2) int[] location) {
...
}
Summary
Public methods |
|
|---|---|
abstract long |
max()A maximum size, inclusive |
abstract long |
min()A minimum size, inclusive |
abstract long |
multiple()The size must be a multiple of this factor |
abstract 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)
public final 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)
public final 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