Heracles.ts

@hydra-cg/heracles.ts > IHypermediaContainer

Interface: IHypermediaContainer

Provides an abstraction layer over hypermedia container.

Hierarchy

ResourceFilterableCollection<IResource>

IResource

↳ IHypermediaContainer

Implemented by

Index

Constructors

Properties

Accessors

Methods


Constructors

constructor

new IHypermediaContainer(resources?: Iterable<IResource>): IHypermediaContainer

Inherited from ResourceFilterableCollection.constructor

Overrides FilterableCollection.constructor

Defined in DataModel/Collections/ResourceFilterableCollection.ts:8

Initializes a new instance of the {@link ResourceFilterableCollection} class with initial collections of resources to filter.

Parameters:

Name Type
Optional resources Iterable<IResource>

Returns: IHypermediaContainer


Properties

collections

● collections: ResourceFilterableCollection<ICollection>

Defined in DataModel/IHypermediaContainer.ts:27

Gets discovered collections.


headers

● headers: IHeaders

Defined in DataModel/IHypermediaContainer.ts:44

Gets response headers.


iri

● iri: string

Inherited from IResource.iri

Defined in DataModel/IResource.ts:13

Gets an Iri of a resource.

readonly:

returns:


● links: LinksCollection

Defined in DataModel/IHypermediaContainer.ts:17

Gets a collection of links.


<Optional> members

● members: ResourceFilterableCollection<IResource>

Defined in DataModel/IHypermediaContainer.ts:33

Gets a collection members. This may be null if the resource owning this container is not a hydra:Collection.


operations

● operations: OperationsCollection

Defined in DataModel/IHypermediaContainer.ts:22

Gets possible operations.


type

● type: TypesCollection

Inherited from IResource.type

Defined in DataModel/IResource.ts:20

Gets classes a given resource is of.

readonly:

returns:


<Optional> view

● view: IHydraResource

Defined in DataModel/IHypermediaContainer.ts:39

Gets a partial collection view. This may be null if the resource owning this container is not a hydra:Collection with hydra:view.


Accessors

length

get length(): number

Inherited from FilterableCollection.length

Defined in DataModel/Collections/FilterableCollection.ts:38

Gets the number of items in this collection.

readonly:

Returns: number


Methods

__@iterator

__@iterator(): Iterator<IResource>

Inherited from FilterableCollection.[@iterator](/Heracles.ts/classes/filterablecollection.html#_iterator)

Defined in DataModel/Collections/FilterableCollection.ts:111

inheritdoc:

Returns: Iterator<IResource>


any

any(): boolean

Inherited from FilterableCollection.any

Defined in DataModel/Collections/FilterableCollection.ts:52

Checks whether this collection has any items fitlered.

Returns: boolean


<Protected> createInstance

createInstance(items: Iterable<IResource>): ResourceFilterableCollection<IResource>

Inherited from ResourceFilterableCollection.createInstance

Overrides FilterableCollection.createInstance

Defined in DataModel/Collections/ResourceFilterableCollection.ts:54

Parameters:

Name Type
items Iterable<IResource>

Returns: ResourceFilterableCollection<IResource>


first

first(): IResource

Inherited from FilterableCollection.first

Defined in DataModel/Collections/FilterableCollection.ts:60

Gets the first item of the collection or null if there are no items matching the criteria.

Returns: IResource


<Optional> getIterator

getIterator(): IPartialCollectionIterator

Defined in DataModel/IHypermediaContainer.ts:51

Gets a part iterator associated with the collection. This may be null if the resource owning this container is not a hydra:Collection with hydra:view.

Returns: IPartialCollectionIterator


last

last(): IResource

Inherited from FilterableCollection.last

Defined in DataModel/Collections/FilterableCollection.ts:69

Gets the last item of the collection or null if there are no items matching the criteria.

Returns: IResource


<Protected> narrowFiltersWith

narrowFiltersWith<TValue>(predicate: string, matchEvaluator: function): FilterableCollection<IResource>

narrowFiltersWith(predicate: string, value: string | RegExp): FilterableCollection<IResource>

Inherited from FilterableCollection.narrowFiltersWith

Defined in DataModel/Collections/FilterableCollection.ts:129

Creates a new instance of the FilterableCollection with filter made narrower with given predicate.

Type parameters:

TValue

Parameters:

Name Type Description
predicate string Predicate of the filter.
matchEvaluator function Match evaluator of the predicate to filter.

Returns: FilterableCollection<IResource>

Inherited from FilterableCollection.narrowFiltersWith

Defined in DataModel/Collections/FilterableCollection.ts:140

Creates a new instance of the FilterableCollection with filter made narrower with given predicate.

Parameters:

Name Type Description
predicate string Predicate of the filter.
value string | RegExp Either value or regular expression to match the value of the predicate to filter.

Returns: FilterableCollection<IResource>


nonBlank

nonBlank(): ResourceFilterableCollection<IResource>

Inherited from ResourceFilterableCollection.nonBlank

Defined in DataModel/Collections/ResourceFilterableCollection.ts:50

Obtains a collection of resources being non blank nodes;

Returns: ResourceFilterableCollection<IResource>


ofIri

ofIri(iri: string): ResourceFilterableCollection<IResource>

Inherited from ResourceFilterableCollection.ofIri

Defined in DataModel/Collections/ResourceFilterableCollection.ts:37

Obtains a collection of resources of a given Iri;

Parameters:

Name Type Description
iri string Iri of the resources.

Returns: ResourceFilterableCollection<IResource>


ofType

ofType(iri: string): ResourceFilterableCollection<IResource>

Inherited from ResourceFilterableCollection.ofType

Defined in DataModel/Collections/ResourceFilterableCollection.ts:23

Obtains a collection of resources of a given type;

Parameters:

Name Type Description
iri string Type of the resources.

Returns: ResourceFilterableCollection<IResource>


toArray

toArray(): IResource[]

Inherited from FilterableCollection.toArray

Defined in DataModel/Collections/FilterableCollection.ts:101

Flattens this collection to a standard array.

Returns: IResource[]


where

where(matchEvaluator: function): FilterableCollection<IResource>

Inherited from FilterableCollection.where

Defined in DataModel/Collections/FilterableCollection.ts:83

Filters the collection with a generic match evaluator.

Parameters:

Name Type Description
matchEvaluator function Match evaluation delegate.

Returns: FilterableCollection<IResource>