public class ExternalResource extends java.lang.Object implements Deletable, WrappedResource, java.io.Externalizable
Modifier and Type | Field and Description |
---|---|
private java.lang.Long |
id
The resource ID.
|
Constructor and Description |
---|
ExternalResource() |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Perform actual delete of an resource.
|
boolean |
equals(java.lang.Object obj)
Check if this instance equals the given one.
|
int |
hashCode()
Compute the hashcode of this instance.
|
java.lang.Long |
id()
Get this resource's ID.
|
void |
id(long id)
Set this resource's ID.
|
void |
readExternal(java.io.ObjectInput in)
Replacement for the default object reading method.
|
boolean |
unknown()
Reports if this object is unknown.
|
boolean |
valid()
Reports if this object is valid for use.
|
void |
writeExternal(java.io.ObjectOutput out)
Replacement for the default object writing method.
|
public boolean valid()
valid
in interface WrappedResource
true
.public boolean unknown()
unknown
in interface WrappedResource
false
.public java.lang.Long id()
id
in interface WrappedResource
public void id(long id)
id
in interface WrappedResource
id
- The resource's ID.public void delete()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The object to check.true
if obj
is a ExternalResource
and its
id
is the same as the one in this instance.public int hashCode()
hashCode
in class java.lang.Object
Long.hashCode(long)
called on the id
.public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- The output destination to which fields will be saved.java.io.IOException
- In case of I/O errors.public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- The input source from which fields will be restored.java.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If payload can't be instantiated.