public class Resource<T> extends Object implements ResourceModel<T>
Constructor and Description |
---|
Resource(String resourceID)
creates a new Resource.
|
Resource(String resourceID,
Identification provider)
creates a new Resource.
|
Resource(String resourceID,
Identification provider,
Identification consumer)
creates a new Resource.
|
Resource(String resourceID,
Identification provider,
T t)
creates a new Resource.
|
Resource(String resourceID,
Identification provider,
T t,
Identification consumer)
creates a new Resource.
|
Resource(String resourceID,
T t,
Identification consumer)
creates a new Resource.
|
Modifier and Type | Method and Description |
---|---|
Identification |
getConsumer()
returns the consumer of the object (if set).
|
String |
getID()
An ID must always be unique.
|
Identification |
getProvider()
returns the provider of the Resource.
|
T |
getResource()
returns the associated Resource data if set.
|
String |
getResourceID()
returns the ID of the Resource.
|
boolean |
hasProvider()
returns whether a provider is set
|
Resource<T> |
setConsumer(Identification consumer)
sets who should or has consumed the Resource Object.
|
Resource<T> |
setProvider(Identification provider)
sets who should or has provided the Resource Object.
|
Resource<T> |
setResource(T resource)
sets the Resource data.
|
List<Resource> |
toList()
creates a list with this Element in it.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isOwner
public Resource(String resourceID)
resourceID
- the ID of the Resourcepublic Resource(String resourceID, Identification provider)
resourceID
- the ID of the Resourceprovider
- the Provider of the Resourcepublic Resource(String resourceID, Identification provider, T t)
resourceID
- the ID of the Resourceprovider
- the Provider of the Resourcet
- the resourcepublic Resource(String resourceID, T t, Identification consumer)
resourceID
- the ID of the Resourceconsumer
- the ID of the Consumert
- the resourcepublic Resource(String resourceID, Identification provider, Identification consumer)
resourceID
- the ID of the Resourceprovider
- the Provider of the Resourceconsumer
- the ID of the Consumerpublic Resource(String resourceID, Identification provider, T t, Identification consumer)
resourceID
- the ID of the Resourceprovider
- the Provider of the Resourcet
- the resourceconsumer
- the ID of the Consumerpublic T getResource()
getResource
in interface ResourceModel<T>
public Resource<T> setResource(T resource)
Note! this Object is immutable!
resource
- the data to setpublic String getResourceID()
getResourceID
in interface ResourceModel<T>
public Identification getProvider()
getProvider
in interface ResourceModel<T>
public boolean hasProvider()
hasProvider
in interface ResourceModel<T>
public Resource<T> setProvider(Identification provider)
Note! this Object is immutable!
provider
- an Identification describing the provider of the Resourcepublic Identification getConsumer()
getConsumer
in interface ResourceModel<T>
public Resource<T> setConsumer(Identification consumer)
Note! this Object is immutable!
consumer
- an Identification describing the consumer of the Resourcepublic String getID()
getID
in interface Identifiable
Copyright © 2016. All rights reserved.