All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.axellience.vueroutergwt.client.Location Maven / Gradle / Ivy

There is a newer version: 1.0.1
Show newest version
package com.axellience.vueroutergwt.client;

import static com.axellience.vuegwt.core.client.tools.JsUtils.map;

import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
import jsinterop.base.JsPropertyMap;

/**
 * @author Adrien Baron
 */
@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
public final class Location
{
    @JsProperty private String name;
    @JsProperty private String path;
    @JsProperty private String hash;
    @JsProperty private JsPropertyMap query;
    @JsProperty private JsPropertyMap params;
    @JsProperty private boolean append;
    @JsProperty private boolean replace;

    @JsOverlay
    public final String getName()
    {
        return name;
    }

    @JsOverlay
    public final Location setName(String name)
    {
        this.name = name;
        return this;
    }

    @JsOverlay
    public final String getPath()
    {
        return path;
    }

    @JsOverlay
    public final Location setPath(String path)
    {
        this.path = path;
        return this;
    }

    @JsOverlay
    public final String getHash()
    {
        return hash;
    }

    @JsOverlay
    public final Location setHash(String hash)
    {
        this.hash = hash;
        return this;
    }

    @JsOverlay
    public final JsPropertyMap getQuery()
    {
        return query;
    }

    @JsOverlay
    public final Location setQuery(JsPropertyMap query)
    {
        this.query = query;
        return this;
    }

    @JsOverlay
    public final Location setQueryParameter(String key, String value)
    {
        if (this.query == null)
            this.query = map();

        this.query.set(key, value);
        return this;
    }

    @JsOverlay
    public final JsPropertyMap getParams()
    {
        return params;
    }

    @JsOverlay
    public final Location setParams(JsPropertyMap params)
    {
        this.params = params;
        return this;
    }

    @JsOverlay
    public final Location setParam(String key, String value)
    {
        if (this.params == null)
            this.params = map();

        this.params.set(key, value);
        return this;
    }

    @JsOverlay
    public final boolean isAppend()
    {
        return append;
    }

    @JsOverlay
    public final Location setAppend(boolean append)
    {
        this.append = append;
        return this;
    }

    @JsOverlay
    public final boolean isReplace()
    {
        return replace;
    }

    @JsOverlay
    public final Location setReplace(boolean replace)
    {
        this.replace = replace;
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy