Java doesn't have a syntax like that, but you can put the "or" in a regex:
if (!str5.matches(".*(Vertex|Name|Transmittance).*")) {
Note that java's matches()
(unlike many other languages) must match the whole string to return true, hence the .*
at each end of the regex.