public static class Resource.Item extends Resource
This class should never be directly instantiated. Always use of(java.lang.String)
method to create a new instance.
Resource.GenericParent, Resource.Id, Resource.Item, Resource.Nested, Resource.Paged
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.util.Optional<Resource.Id> |
getIdOptional()
The resource's ID, if present;
Optional#empty otherwise. |
int |
hashCode() |
static Resource.Item |
of(java.lang.String name)
Creates a new
Resource.Item with the provided name . |
static Resource.Item |
of(java.lang.String name,
Resource.Id id)
|
java.lang.String |
toString() |
Resource.Item |
withId(Resource.Id id)
Copies the current
Resource.Item by setting a value for the ID attribute. |
public static Resource.Item of(java.lang.String name)
Resource.Item
with the provided name
.public static Resource.Item of(java.lang.String name, Resource.Id id)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.util.Optional<Resource.Id> getIdOptional()
Optional#empty
otherwise. This
component is not taken into account when performing an #equals)
check.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public Resource.Item withId(Resource.Id id)
Resource.Item
by setting a value for the ID
attribute. A shallow reference equality
check is used to prevent copying of the same value by returning
this
.id
- the new IDthis
object