public class PageParameters extends Object implements IPageParameters, Serializable
DomUtil#addUrlParameters(StringBuilder, PageParameters, boolean).| Constructor and Description |
|---|
PageParameters()
Create an empty PageParameters.
|
PageParameters(Object... list)
Create page parameters and fill with the initial set defined in the argument list.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addParameter(String name,
Object value)
Adds a parameter with the specified name.
|
void |
addParameters(Object... plist)
Add parameters.
|
static void |
applyChanges(PageParameters source,
PageParameters changes)
Apply changes to source.
|
String |
calculateHashString()
EXPENSIVE Hash all parameter values into an MD5 hash.
|
static PageParameters |
createFrom(IRequestContext ctx)
Create this from an actual request.
|
static PageParameters |
createFromEncodedUrlString(String paramsAsString)
Create this from an string representation of params.
|
static PageParameters |
decodeParameters(String query)
Decode a http query string into a PageParameters instance.
|
boolean |
equals(Object obj)
Compare this with another instance.
|
boolean |
getBoolean(String name)
Gets the value for the specified parametername as a boolean (primitive).
|
boolean |
getBoolean(String name,
boolean df)
Gets the value for the specified parametername as a boolean (primitive).
|
int |
getDataLength()
Return the number of characters that this would take on an url.
|
int |
getInt(String name)
Gets the value for the specified parametername as an int (primitive).
|
int |
getInt(String name,
int df)
Gets the value for the specified parametername as an int (primitive).
|
long |
getLong(String name)
Gets the value for the specified parametername as a long (primitive).
|
long |
getLong(String name,
long df)
Gets the value for the specified parametername as a long (primitive).
|
Long |
getLongW(String name)
Gets the value for the specified parametername as a Long object.
|
Long |
getLongW(String name,
long df)
Gets the value for the specified parametername as a Long object.
|
Long |
getLongW(String name,
Long df)
Gets the value for the specified parametername as a Long object.
|
Object |
getObject(String name)
Gets the value for the specified parameter name as untyped value.
|
String[] |
getParameterNames()
Gets all the names of the parameters this object is holding
|
String |
getString(String name)
Gets the value for the specified parametername as a String object.
|
String |
getString(String name,
String df)
Gets the value for the specified parametername as a String object.
|
String[] |
getStringArray(String name)
Gets the value for the specified parametername as a String array.
|
String[] |
getStringArray(String name,
String[] deflt) |
PageParameters |
getUnlockedCopy()
Creates copy of current PageParameters.
|
int |
hashCode() |
boolean |
hasParameter(String name)
Indicates whether a given parameter name exists in this PageParameters object.
|
boolean |
isReadOnly() |
void |
putObject(String name,
Object value) |
void |
removeParameter(String name)
Removes the parameter with specified name entirely from the map.
|
void |
setReadOnly() |
int |
size()
Return the number of parameter (names) in this instance.
|
String |
toString() |
public PageParameters()
public PageParameters(Object... list)
addParameters(Object...).list - @Nonnull public PageParameters getUnlockedCopy()
IPageParametersgetUnlockedCopy in interface IPageParametersIPageParameters.getUnlockedCopy()public void setReadOnly()
public void addParameters(Object... plist) throws Exception
IIdentifyable
the primary key for the object will be rendered as the value, otherwise it will be rendered as a tostring.
You can also specify a single object in the location for the next key; in this case both key and value will
be determined from this object; it must be some persistent object which knows it's key field.plist - Exceptionpublic void addParameter(String name, Object value)
name, - the parameter name.value, - the (new) value.public void removeParameter(String name)
name, - the name of the parameter to be removed.public boolean hasParameter(String name)
IPageParametershasParameter in interface IPageParametersIPageParameters.hasParameter(java.lang.String)public int size()
size in interface IPageParameterspublic int getInt(String name)
IPageParametersgetInt in interface IPageParametersIPageParameters.getInt(java.lang.String)public int getInt(String name, int df)
IPageParametersgetInt in interface IPageParametersIPageParameters.getInt(java.lang.String, int)public long getLong(String name)
IPageParametersgetLong in interface IPageParametersIPageParameters.getLong(java.lang.String)public long getLong(String name, long df)
IPageParametersgetLong in interface IPageParametersIPageParameters.getLong(java.lang.String, long)public boolean getBoolean(String name)
IPageParametersgetBoolean in interface IPageParametersIPageParameters.getBoolean(java.lang.String)public boolean getBoolean(String name, boolean df)
IPageParametersgetBoolean in interface IPageParametersIPageParameters.getBoolean(java.lang.String, boolean)public Long getLongW(String name)
IPageParametersgetLongW in interface IPageParametersIPageParameters.getLongW(java.lang.String)public Long getLongW(String name, long df)
IPageParametersgetLongW in interface IPageParametersIPageParameters.getLongW(java.lang.String, long)public Long getLongW(String name, Long df)
IPageParametersgetLongW in interface IPageParametersIPageParameters.getLongW(java.lang.String, java.lang.Long)@Nonnull public String getString(String name)
IPageParametersgetString in interface IPageParametersIPageParameters.getString(java.lang.String)@Nullable public String getString(String name, String df)
IPageParametersgetString in interface IPageParametersIPageParameters.getString(java.lang.String, java.lang.String)@Nonnull public String[] getStringArray(@Nonnull String name)
IPageParametersgetStringArray in interface IPageParametersIPageParameters.getStringArray(java.lang.String)@Nullable public String[] getStringArray(@Nonnull String name, @Nullable String[] deflt)
getStringArray in interface IPageParametersIPageParameters.getStringArray(java.lang.String, java.lang.String[])@Nullable public Object getObject(String name)
name - @Nonnull public static PageParameters createFrom(IRequestContext ctx)
c - @Nonnull public static PageParameters createFromEncodedUrlString(@Nonnull String paramsAsString)
paramsAsString - @Nonnull public String[] getParameterNames()
IPageParametersgetParameterNames in interface IPageParametersIPageParameters.getParameterNames()public boolean equals(Object obj)
IPageParametersWe check the size of the maps; if they are equal we ONLY have to check that each key-value pair in SOURCE exists in TARGET AND is the same. We don't need to check for "thingies in SRC that do not occur in TGT" because that cannot happen if the map sizes are equal.
equals in interface IPageParametersequals in class ObjectIPageParameters.equals(java.lang.Object)public int hashCode()
hashCode in interface IPageParametershashCode in class ObjectIPageParameters.hashCode()public static void applyChanges(PageParameters source, PageParameters changes)
source - changes - @Nonnull public String calculateHashString()
IPageParameterscalculateHashString in interface IPageParametersIPageParameters.calculateHashString()public int getDataLength()
IPageParametersgetDataLength in interface IPageParametersIPageParameters.getDataLength()public boolean isReadOnly()
isReadOnly in interface IPageParameters@Nonnull public static PageParameters decodeParameters(@Nullable String query)
query - Copyright © 2017 etc.to. All rights reserved.