The Java version of the "Pipeline option patterns" article simply does not work.
When creating a PipelineOptions inside of a DoFn, all get methods that return ValueProvider<T> will return null instead. The closest working example I could find was from Google's guide on [ValueProviders in Dataflow templates|#using-valueprovider-in-your-functions]. The pattern involves passing the ValueProvider into a DoFn class's constructor, storing it, then later accessing it at runtime.
Imported from Jira BEAM-10700. Original Jira may contain additional context.
Reported by: mtruscello.