public class Resource extends BaseEntity
Persona or is a sub resource (ie: it has a
parent Resource). At the end of the chain, there must be a valid owner.
The parent of a Resource can be reset by first setting an owner and then setting the parent to null. Failure to
set an owner before resetting the parent will lead to IllegalStateException. Similarly,
attempting to set the Owner to null without a valid parent first will lead to .IllegalStateException.| Modifier and Type | Class and Description |
|---|---|
static class |
Resource.Builder |
| Constructor and Description |
|---|
Resource(Persona persona)
Creates a new resource with the given owner.
|
Resource(Persona persona,
Resource parent)
Creates a new sub resource with a parent and an owner, which may or may not be the same as the parent's.
|
Resource(Resource parent)
Creates a new sub resource with a parent.
|
Resource(String id,
Persona persona)
Creates a new resource with the given id and owner.
|
Resource(String id,
Persona persona,
Resource parent)
Creates a new sub resource with the given id, owner and parent resource.
|
Resource(String id,
Resource parent)
Creates a new resource with the given id and owner.
|
Resource(UUID id,
ZonedDateTime createdAt,
ZonedDateTime updatedAt,
Persona persona,
Resource parent) |
| Modifier and Type | Method and Description |
|---|---|
Resource |
getParent() |
Persona |
getPersona() |
void |
setParent(Resource parent) |
void |
setPersona(Persona persona) |
equals, getCreatedAt, getId, getIdAsUUID, getUpdatedAt, hashCode, setUpdatedAt, toStringpublic Resource(Persona persona)
persona - the owner of this sub resourceIllegalStateException - if the owner is nullpublic Resource(Resource parent)
parent - the parent of this sub resourceIllegalStateException - if the parent is nullpublic Resource(Persona persona, Resource parent)
parent - the parent of this sub resourcepersona - the owner of this sub resourceIllegalStateException - if both the parent and the owner are nullpublic Resource(String id, Resource parent)
id - the id that this resource should have or null for a new UUIDparent - the parent of this sub resourceIllegalStateException - if the owner is nullpublic Resource(String id, Persona persona)
id - the id that this resource should have or null for a new UUIDpersona - the owner of this sub resourceIllegalStateException - if the owner is nullpublic Resource(String id, Persona persona, Resource parent)
id - the id that this resource should have or null for a new UUIDparent - the parent of this sub resourcepersona - the owner of this sub resourceIllegalStateException - if both the parent and the owner are nullpublic Resource(UUID id, ZonedDateTime createdAt, ZonedDateTime updatedAt, Persona persona, Resource parent)
Copyright © 2015 Red Hat, Inc.. All rights reserved.