public abstract class NamedCloseable
extends java.lang.Object
implements java.io.Closeable
Modifier | Constructor and Description |
---|---|
protected |
NamedCloseable() |
protected |
NamedCloseable(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the underlying closeable catching any exception.
|
protected abstract java.io.Closeable |
getCloseable()
Returns the closeable that is associated with the name defined in this class.
|
java.lang.String |
getName() |
void |
setName(java.lang.String name)
Sets the name of the associated closeable.
|
protected NamedCloseable()
protected NamedCloseable(java.lang.String name)
public java.lang.String getName()
public void setName(java.lang.String name)
name
- The new name (must not be null).java.lang.IllegalArgumentException
- If the given name is null.public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
protected abstract java.io.Closeable getCloseable()