Package ubic.gemma.rest.util.args
Class LimitArg
- java.lang.Object
-
- ubic.gemma.rest.util.args.AbstractArg<Integer>
-
- ubic.gemma.rest.util.args.LimitArg
-
public class LimitArg extends AbstractArg<Integer>
Argument used to represent a limit.
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAXIMUM
This is the default maximum used forgetValue()
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
getValue()
Obtain the value of the limit ensuring that it is smaller thanMAXIMUM
Integer
getValue(Integer maximum)
Obtain the value of the limit and ensure it is smaller than a given maximum.Integer
getValueNoMaximum()
Obtain the value of the limit, explicitly disregarding the maximum defined byMAXIMUM
.static LimitArg
valueOf(String s)
-
Methods inherited from class ubic.gemma.rest.util.args.AbstractArg
toString
-
-
-
-
Field Detail
-
MAXIMUM
public static int MAXIMUM
This is the default maximum used forgetValue()
.
-
-
Method Detail
-
getValue
@Nonnull public Integer getValue()
Obtain the value of the limit ensuring that it is smaller thanMAXIMUM
-
getValue
public Integer getValue(Integer maximum) throws MalformedArgException
Obtain the value of the limit and ensure it is smaller than a given maximum. UsegetValue()
to accept any limit.- Parameters:
maximum
- a maximum the limit must not exceeed, otherwise aMalformedArgException
will be raised- Throws:
MalformedArgException
- of the limit is exceeded, or the argument was malformed in the first place.
-
getValueNoMaximum
public Integer getValueNoMaximum()
Obtain the value of the limit, explicitly disregarding the maximum defined byMAXIMUM
.
-
valueOf
public static LimitArg valueOf(String s) throws MalformedArgException
- Throws:
MalformedArgException
-
-