Home Reference Source Repository
import OlapicEntitiesHandler from 'OlapicDevKit-ES6/src/core/interfaces/handler.js'
public class | source

OlapicEntitiesHandler

This is an abstract class that all the entities handler will extend and implement.

Static Member Summary

Static Public Members
public static get

A quick shortcut to get access to the DevKit singleton.

Static Method Summary

Static Public Methods
public static

This will be used when creating an entity to parse any list of action forms and returns them with a better format.

public static

This will be used when creating an entity to parse any list of linked entities and returns them with a better format.

Static Public Members

public static get DevKit: OlapicDevKit: * source

A quick shortcut to get access to the DevKit singleton.

Return:

OlapicDevKit

The singleton instance.

Static Public Methods

public static getFormsFromObject(obj: Object): Object source

This will be used when creating an entity to parse any list of action forms and returns them with a better format.

Params:

NameTypeAttributeDescription
obj Object

The object to parse.

Return:

Object

The formatted object.

Example:

// This will return {streams:{search:{method:'GET}}}
.getFormsFromObject({
    'streams:search': {
        method: 'GET',
    },
});

public static getResourcesFromObject(obj: Object): Object source

This will be used when creating an entity to parse any list of linked entities and returns them with a better format.

Params:

NameTypeAttributeDescription
obj Object

The object to parse.

Return:

Object

The formatted object.

Example:

// This will return {media:{recent:{link:'...'}}}
.getResourcesFromObject({
    'media:recent': {
        _links: {
            self: {
                href: '...',
            },
        },
    },
});