public final class Limits extends HTTPParameter
Modifier and Type | Class and Description |
---|---|
class |
Limits.TypeLimits
A type specific limit clause.
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_ITEMS
The default maximum amount of items if no last item is specified
|
static java.lang.String |
PARAMETER_DEFAULT_NAME
the default HTTP parameter name
|
Constructor and Description |
---|
Limits()
create default limits
|
Limits(int startItem,
int endItem)
Initialize limits
|
Modifier and Type | Method and Description |
---|---|
int |
getEndItem() |
int |
getEndItem(java.lang.String typeName) |
int |
getMaxItems() |
int |
getMaxItems(java.lang.String typeName) |
int |
getStartItem() |
int |
getStartItem(java.lang.String typeName) |
Limits.TypeLimits |
getTypeLimits(java.lang.String typeName)
Note: if no limits for the given typeName is found, this will return the default limits.
|
java.lang.Object |
getValue() |
boolean |
hasValues()
always true
|
void |
initialize(java.util.List<java.lang.String> parameterValues)
Initialize this parameter based on the given parameter values
|
void |
initialize(java.lang.String parameterValue)
Initialize this parameter based on the given parameter value
|
void |
setTypeLimits(int startItem,
int endItem,
java.lang.String typeName) |
java.lang.String |
toLimitString() |
getParameterName, initialize, initializeRaw, initializeRaw, setParameterName
public static final java.lang.String PARAMETER_DEFAULT_NAME
public static final int DEFAULT_MAX_ITEMS
public Limits(int startItem, int endItem)
startItem
- if < 0, 0 will be usedendItem
- the last item index (inclusively), if <= startItem, startItem+DEFAULT_MAX_ITEM-1 will be usedpublic Limits()
public java.lang.String toLimitString()
public void setTypeLimits(int startItem, int endItem, java.lang.String typeName)
startItem
- endItem
- typeName
- setting to null will replace the default (global) limitspublic int getStartItem()
public int getEndItem()
public int getMaxItems()
public int getStartItem(java.lang.String typeName)
typeName
- public int getEndItem(java.lang.String typeName)
typeName
- public Limits.TypeLimits getTypeLimits(java.lang.String typeName)
typeName
- public int getMaxItems(java.lang.String typeName)
typeName
- public void initialize(java.util.List<java.lang.String> parameterValues) throws java.lang.IllegalArgumentException
HTTPParameter
initialize
in class HTTPParameter
parameterValues
- can NOT be nulljava.lang.IllegalArgumentException
- on bad input datapublic void initialize(java.lang.String parameterValue) throws java.lang.IllegalArgumentException
HTTPParameter
initialize
in class HTTPParameter
parameterValue
- can be nulljava.lang.IllegalArgumentException
- on bad input datapublic boolean hasValues()
hasValues
in class HTTPParameter
public java.lang.Object getValue()
getValue
in class HTTPParameter
Copyright © 2015 Tampere University of Technology, Pori Department.