public interface Resource
A resource can potentially have linked child resources
Modifier and Type | Interface and Description |
---|---|
static class |
Resource.StringResource
Simple value type wrapper implementation for a resource
String . |
Modifier and Type | Method and Description |
---|---|
default Set<? extends Resource> |
children()
Returns children
Resource instances associated with this
instance, potentially none (empty collection, but never null). |
static Resource |
New(String name)
Creates a new
Resource instance of a simple default type with the
passed resource name. |
static Resource |
provide(Resource existingInstance,
String name,
Set<String> children)
Provides a
Resource instance for the passed name. |
static void |
update(Resource resource,
String resourceName,
Set<Resource> children)
Updates the passed
Resource instance for the passed values, where
updating means simply validating the instance in the simple default case. |
default Set<? extends Resource> children()
Resource
instances associated with this
instance, potentially none (empty collection, but never null).static Resource New(String name)
Resource
instance of a simple default type with the
passed resource name. The passed name may not be null.static Resource provide(Resource existingInstance, String name, Set<String> children)
Resource
instance for the passed name. If the passed
existing instance is not null, it is validated for the specified
values, otherwise, a new Resource
instance of a simple default
type is created and returned.name
- the identifying name of the Resource
to be providedexistingInstance
- an already existing Resource
instance for the passed
name, potentially null.children
- the identifying names of the specified resource's child
resources, potentially empty.Resource
instance that is guaranteed to have the
specified name.static void update(Resource resource, String resourceName, Set<Resource> children)
Resource
instance for the passed values, where
updating means simply validating the instance in the simple default case.resourceName
- the resource's identifying name.resource
- the Resource
instance to be updated.children
- the resource's children, potentially none.