public static class Resource.GenericParent extends Resource
This class is intended for those kind of resources that must be scoped, but that scope (a.k.a. parent) cannot be another resource.
Example:
- Comments of a blog post (Resource.Nested
): /blog-post/42/comment
- Comments by generic parent (Resource.GenericParent
: /comment/by-generic-parent/blog-post:42
This class should never be directly instantiated. Always use of(java.lang.String, com.liferay.apio.architect.resource.Resource.Id, 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> |
getParentIdOptional()
The resource's generic parent ID.
|
java.lang.String |
getParentName()
The resource's generic parent name.
|
int |
hashCode() |
static Resource.GenericParent |
of(java.lang.String parentName,
Resource.Id parentId,
java.lang.String name)
Creates a new
Resource.GenericParent with the provided parent and
name information. |
static Resource.GenericParent |
of(java.lang.String parentName,
java.lang.String name)
Creates a new
Resource.GenericParent with the provided parent and
name information. |
java.lang.String |
toString() |
Resource.GenericParent |
withParentId(Resource.Id id)
Copies the current
Resource.GenericParent by setting a value for the
generic parent's ID attribute. |
public static Resource.GenericParent of(java.lang.String parentName, Resource.Id parentId, java.lang.String name)
Resource.GenericParent
with the provided parent and
name
information.public static Resource.GenericParent of(java.lang.String parentName, java.lang.String name)
Resource.GenericParent
with the provided parent and
name
information.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.util.Optional<Resource.Id> getParentIdOptional()
public java.lang.String getParentName()
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public Resource.GenericParent withParentId(Resource.Id id)
Resource.GenericParent
by setting a value for the
generic parent's ID attribute. A shallow reference equality check is
used to prevent copying of the same value by returning this
.id
- the new IDthis
object