1 /* |
1 /* |
2 * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
24 */ |
24 */ |
25 |
25 |
26 package jdk.jfr.consumer; |
26 package jdk.jfr.consumer; |
27 |
27 |
28 import java.lang.reflect.Modifier; |
28 import java.lang.reflect.Modifier; |
29 import java.util.List; |
|
30 |
29 |
31 import jdk.jfr.ValueDescriptor; |
30 import jdk.jfr.internal.consumer.ObjectContext; |
32 import jdk.jfr.internal.Type; |
|
33 |
31 |
34 /** |
32 /** |
35 * A recorded Java type, such as a class or an interface. |
33 * A recorded Java type, such as a class or an interface. |
36 * |
34 * |
37 * @since 9 |
35 * @since 9 |
38 */ |
36 */ |
39 public final class RecordedClass extends RecordedObject { |
37 public final class RecordedClass extends RecordedObject { |
40 |
|
41 static ObjectFactory<RecordedClass> createFactory(Type type, TimeConverter timeConverter) { |
|
42 return new ObjectFactory<RecordedClass>(type) { |
|
43 @Override |
|
44 RecordedClass createTyped(List<ValueDescriptor> desc, long id, Object[] object) { |
|
45 return new RecordedClass(desc, id, object, timeConverter); |
|
46 } |
|
47 }; |
|
48 } |
|
49 |
|
50 private final long uniqueId; |
38 private final long uniqueId; |
51 |
39 |
52 // package private |
40 // package private |
53 private RecordedClass(List<ValueDescriptor> descriptors, long id, Object[] values, TimeConverter timeConverter) { |
41 RecordedClass(ObjectContext objectContext, long id, Object[] values) { |
54 super(descriptors, values, timeConverter); |
42 super(objectContext, values); |
55 this.uniqueId = id; |
43 this.uniqueId = id; |
56 } |
44 } |
57 |
45 |
58 /** |
46 /** |
59 * Returns the modifiers of the class. |
47 * Returns the modifiers of the class. |