Class ResourceImpl
java.lang.Object
org.gcube.informationsystem.base.impl.ElementImpl
org.gcube.informationsystem.base.impl.entities.EntityElementImpl
org.gcube.informationsystem.model.impl.entities.EntityImpl
org.gcube.informationsystem.model.impl.entities.ResourceImpl
- All Implemented Interfaces:
Serializable,Element,EntityElement,IdentifiableElement,Entity,Resource,ERElement,ModelElement
- Direct Known Subclasses:
DummyResource
The default abstract implementation of the
Resource interface.- Author:
- Luca Frosini (ISTI - CNR)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<ConsistsOf<? extends Resource,? extends Facet>> The list ofConsistsOfrelations.protected List<IsRelatedTo<? extends Resource,? extends Resource>> The list ofIsRelatedTorelations.Fields inherited from class org.gcube.informationsystem.model.impl.entities.EntityImpl
contexts, expectedtype, supertypesFields inherited from class org.gcube.informationsystem.base.impl.entities.EntityElementImpl
metadata, uuidFields inherited from interface org.gcube.informationsystem.base.reference.Element
DATETIME_PATTERN, NAME, TYPE_PROPERTYFields inherited from interface org.gcube.informationsystem.base.reference.entities.EntityElement
NAMEFields inherited from interface org.gcube.informationsystem.model.reference.ERElement
CONTEXTS_PROPERTYFields inherited from interface org.gcube.informationsystem.base.reference.IdentifiableElement
ID_PROPERTY, METADATA_PROPERTYFields inherited from interface org.gcube.informationsystem.model.reference.ModelElement
EXPECTED_TYPE_PROPERTY, SUPERTYPES_PROPERTYFields inherited from interface org.gcube.informationsystem.model.reference.entities.Resource
CONSISTS_OF_PROPERTY, IS_RELATED_TO_PROPERTY, NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<C extends ConsistsOf<? extends Resource,? extends Facet>>
voidaddFacet(C relation) Adds a facet to the resource via aConsistsOfrelation.<F extends Facet>
voidaddFacet(F facet) Adds a facet to the resource.voidAdds a facet to the resource by its UUID.voidattachResource(IsRelatedTo relation) Attaches another resource to this one via anIsRelatedTorelation.List<ConsistsOf<? extends Resource,? extends Facet>> Returns allConsistsOfrelations for this resource, linking it to its facets.<C extends ConsistsOf<? extends Resource,? extends Facet>>
List<C>getConsistsOf(Class<C> clz) ReturnsConsistsOfrelations of a specific type.<F extends Facet,C extends ConsistsOf<? extends Resource, F>>
List<C>getConsistsOf(Class<C> clz, Class<F> facetClz) ReturnsConsistsOfrelations of a specific type, targeting a specific facet type.Returns all facets associated with this resource.<F extends Facet,C extends ConsistsOf<? extends Resource, F>>
List<F>Returns facets of a specific type, linked by a specificConsistsOfrelation type.Returns all facets of a specific type associated with this resource.List<IsRelatedTo<? extends Resource,? extends Resource>> Returns allIsRelatedTorelations for this resource, linking it to other resources.<I extends IsRelatedTo<? extends Resource,? extends Resource>>
List<I>getIsRelatedTo(Class<I> clz) ReturnsIsRelatedTorelations of a specific type.Methods inherited from class org.gcube.informationsystem.model.impl.entities.EntityImpl
getContexts, getExpectedtype, getSupertypes, setContextsMethods inherited from class org.gcube.informationsystem.base.impl.entities.EntityElementImpl
getID, getMetadata, setID, setMetadataMethods inherited from class org.gcube.informationsystem.base.impl.ElementImpl
getTypeName, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.gcube.informationsystem.base.reference.Element
getTypeNameMethods inherited from interface org.gcube.informationsystem.base.reference.entities.EntityElement
getID, getMetadata, setID, setMetadataMethods inherited from interface org.gcube.informationsystem.model.reference.ERElement
getContextsMethods inherited from interface org.gcube.informationsystem.model.reference.ModelElement
getExpectedtype, getSupertypes
-
Field Details
-
consistsOfList
The list ofConsistsOfrelations. -
isRelatedToList
The list ofIsRelatedTorelations.
-
-
Constructor Details
-
ResourceImpl
protected ResourceImpl()Default constructor.
-
-
Method Details
-
addFacet
Adds a facet to the resource by its UUID. -
addFacet
Adds a facet to the resource. -
addFacet
Adds a facet to the resource via aConsistsOfrelation. -
attachResource
Attaches another resource to this one via anIsRelatedTorelation.- Specified by:
attachResourcein interfaceResource- Parameters:
relation- The relation instance to add.
-
getConsistsOf
Returns allConsistsOfrelations for this resource, linking it to its facets.- Specified by:
getConsistsOfin interfaceResource- Returns:
- A list of
ConsistsOfrelations.
-
getConsistsOf
public <C extends ConsistsOf<? extends Resource,? extends Facet>> List<C> getConsistsOf(Class<C> clz) ReturnsConsistsOfrelations of a specific type.- Specified by:
getConsistsOfin interfaceResource- Type Parameters:
C- The specific type ofConsistsOfrelation.- Parameters:
clz- The class of the relation type.- Returns:
- A list of matching
ConsistsOfrelations.
-
getIsRelatedTo
Returns allIsRelatedTorelations for this resource, linking it to other resources.- Specified by:
getIsRelatedToin interfaceResource- Returns:
- A list of
IsRelatedTorelations.
-
getIsRelatedTo
public <I extends IsRelatedTo<? extends Resource,? extends Resource>> List<I> getIsRelatedTo(Class<I> clz) ReturnsIsRelatedTorelations of a specific type.- Specified by:
getIsRelatedToin interfaceResource- Type Parameters:
I- The specific type ofIsRelatedTorelation.- Parameters:
clz- The class of the relation type.- Returns:
- A list of matching
IsRelatedTorelations.
-
getFacets
Returns all facets associated with this resource. -
getFacets
Returns all facets of a specific type associated with this resource. -
getConsistsOf
public <F extends Facet,C extends ConsistsOf<? extends Resource, List<C> getConsistsOfF>> (Class<C> clz, Class<F> facetClz) ReturnsConsistsOfrelations of a specific type, targeting a specific facet type.- Specified by:
getConsistsOfin interfaceResource- Type Parameters:
F- The type of the target facet.C- The type of theConsistsOfrelation.- Parameters:
clz- The class of the relation type.facetClz- The class of the target facet type.- Returns:
- A list of matching
ConsistsOfrelations.
-
getFacets
public <F extends Facet,C extends ConsistsOf<? extends Resource, List<F> getFacetsF>> (Class<C> clz, Class<F> facetClz) Returns facets of a specific type, linked by a specificConsistsOfrelation type.
-