Coding a limit Switch in DIO (Java)

Does anyone have a simple code for putting a limit switch on the DIO on the RoboRIO? Is there an example of it somewhere online? Thanks.

Using limit switches to control behavior

If this doesn’t answer your question, let me know.