モジュール jdk.jfr
パッケージ jdk.jfr

注釈インタフェースDataAmount


@Retention(RUNTIME) @Target({FIELD,TYPE,METHOD}) public @interface DataAmount
イベント・フィールド注釈で、値がデータ(たとえば、バイト)の量を表すことを指定します。

次の例は、DataAmount注釈を使用して単位BITSおよびBYTESをイベント・フィールドに設定する方法を示しています。

@Name("com.example.ImageRender")
@Label("Image Render")
public class ImageRender extends Event {
    @Label("Height")
    long height;

    @Label("Width")
    long width;

    @Label("Color Depth")
    @DataAmount(DataAmount.BITS)
    int colorDepth;

    @Label("Memory Size")
    @DataAmount // bytes by default
    long memorySize;
}

導入されたバージョン:
9