Hi Kirtiman,
To rotate the screen to Portrait and Landscape by the following code
driver.rotate(ScreenOrientation.PORTRAIT);
driver.rotate(ScreenOrientation.LANDSCAPE);
To get the current screen orientation value by this code
ScreenOrientation orientation= driver.getOrientation();
orientation.value()