You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
arthas/tutorials/katacoda/command-getstatic-en/getstatic.md

35 lines
1.4 KiB
Markdown

* It is recommended to use the [OGNL] (https://arthas.aliyun.com/doc/arthas-tutorials.html?language=en&id=command-ognl) command, which will be more flexible.
Check the static fields of classes conveniently, the usage is `getstatic class_name field_name`.
`getstatic demo.MathGame random`{{execute T2}}
```bash
$ getstatic demo.MathGame random
field: random
@Random[
serialVersionUID=@Long[3905348978240129619],
seed=@AtomicLong[120955813885284],
multiplier=@Long[25214903917],
addend=@Long[11],
mask=@Long[281474976710655],
DOUBLE_UNIT=@Double[1.1102230246251565E-16],
BadBound=@String[bound must be positive],
BadRange=@String[bound must be greater than origin],
BadSize=@String[size must be non-negative],
seedUniquifier=@AtomicLong[-3282039941672302964],
nextNextGaussian=@Double[0.0],
haveNextNextGaussian=@Boolean[false],
serialPersistentFields=@ObjectStreamField[][isEmpty=false;size=3],
unsafe=@Unsafe[sun.misc.Unsafe@2eaa1027],
seedOffset=@Long[24],
]
```
Tip: if the static field is a complex class, you can even use [`OGNL`](https://commons.apache.org/proper/commons-ognl/language-guide.html) to traverse, filter and access the inner properties of this class.
* [OGNL official guide](https://commons.apache.org/proper/commons-ognl/language-guide.html)
* [Special usages](https://github.com/alibaba/arthas/issues/71)