public class OpenCloseState extends Object
| Constructor and Description |
|---|
OpenCloseState(String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
assertOpen()
Assert this is open.
|
boolean |
close()
Transit to close state.
|
Throwable |
getThrowable() |
boolean |
isClosed() |
boolean |
isOpened() |
boolean |
isUnopened() |
void |
open()
Transit to open state.
|
String |
toString() |
public OpenCloseState(String name)
public void assertOpen()
public boolean isUnopened()
public boolean isOpened()
public boolean isClosed()
public Throwable getThrowable()
public void open()
throws IOException
IOExceptionpublic boolean close()
throws IOException
IOException - if the current state is not allowed to transit to close.Copyright © 2017–2022 The Apache Software Foundation. All rights reserved.