Class Link
java.lang.Object
com.broadleafcommerce.metadata.dsl.core.Link
- All Implemented Interfaces:
Copyable<Link>
,Serializable
Represents a link to a location within the client. This link may target the ID of a component,
which will look for a matching
ComponentRoute
, or provide an explicit path to link to.- Author:
- Nick Crum (ncrum)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
componentId
(String componentId) Sets the component ID of the link.copy()
boolean
The ID of theComponent
targeted by aComponentRoute
that this will provide a link to.getPath()
Alternative tocomponentId
to provide a static path as a link, e.g.int
hashCode()
Adds a parameter with the given name and value.Adds a map of parameters.Sets the path of the link.protected Link
self()
-
Constructor Details
-
Link
public Link() -
Link
-
-
Method Details
-
copy
-
componentId
Sets the component ID of the link.- Parameters:
componentId
- the component ID- Returns:
- the link
-
path
Sets the path of the link.- Parameters:
path
- the path- Returns:
- the link
-
param
Adds a parameter with the given name and value. The value may be a serializable object in which case the request parameter value will become serialized JSON.- Parameters:
name
- the parameter namevalue
- the parameter value- Returns:
- the link
-
params
Adds a map of parameters. The value may be a serializable object in which case the request parameter value will become serialized JSON.- Parameters:
paramsToAdd
- the params to add- Returns:
- the link
-
self
-
getComponentId
The ID of theComponent
targeted by aComponentRoute
that this will provide a link to. -
getPath
Alternative to
componentId
to provide a static path as a link, e.g. "/products/:id". This will take second priority tocomponentId
if you need to statically reference a path.This supports any valid URL path that https://github.com/pillarjs/path-to-regexp/tree/v1.7.0 understands, e.g. "/products", "/products/:id", and "/categories/:id?" are all valid URL paths. Must start with a slash, and optionally may include any path parameters as necessary.
-
getParams
-
equals
-
canEqual
-
hashCode
public int hashCode()
-