public class Link extends Object implements Serializable, Copyable<Link>
ComponentRoute
, or provide an explicit path to link to.Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(Object other) |
Link |
componentId(String componentId)
Sets the component ID of the link.
|
Link |
copy() |
boolean |
equals(Object o) |
String |
getComponentId()
The ID of the
Component targeted by a ComponentRoute that this will provide a
link to. |
Map<String,Object> |
getParams() |
String |
getPath()
Alternative to
componentId to provide a static path as a link, e.g. |
int |
hashCode() |
Link |
param(String name,
Object value)
Adds a parameter with the given name and value.
|
Link |
params(Map<String,Object> paramsToAdd)
Adds a map of parameters.
|
Link |
path(String path)
Sets the path of the link.
|
protected Link |
self() |
public Link()
public Link(Link link)
public Link copy()
public Link componentId(String componentId)
componentId
- the component IDpublic Link path(String path)
path
- the pathpublic Link param(String name, Object value)
name
- the parameter namevalue
- the parameter valuepublic Link params(Map<String,Object> paramsToAdd)
paramsToAdd
- the params to addprotected Link self()
public String getComponentId()
Component
targeted by a ComponentRoute
that this will provide a
link to.public String getPath()
Alternative to componentId
to provide a static path as a link, e.g. "/products/:id".
This will take second priority to componentId
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.
protected boolean canEqual(Object other)
Copyright © 2021. All rights reserved.